2026-10-03 10:56:13 +02:00
using MongoDB.Entities ;
namespace PrivaPub.Models.Statistics
{
public class InteractionEvent : Entity
{
public static readonly TimeSpan Retention = TimeSpan . FromDays ( 90 );
public DateTime At { get ; set ; } = DateTime . UtcNow ;
public string Host { get ; set ; } //the remote server, lowercase; "-" when unverified and unknown
public string Channel { get ; set ; } //recv | in | out | http | preview | crawl
public string Activity { get ; set ; } //Create, Follow, ...; "other" when it is no plain type name
public string Object { get ; set ; } //Note, Article, Person, ...
2026-10-05 04:54:38 +02:00
public string Purpose { get ; set ; } //http and crawl: actor, key, object, context, replies, webfinger, nodeinfo, ...
2026-10-03 10:56:13 +02:00
public string Trigger { get ; set ; } //http: what caused the request (inbox, deliver, describe, request, ...)
public string Outcome { get ; set ; } //queued, refused, accepted, dropped, ok, failed, deferred, retry, dead
public string Reason { get ; set ; }
public int? Status { get ; set ; }
public int? LatencyMs { get ; set ; }
public int? WaitMs { get ; set ; } //in: since it reached the inbox; out: since it was queued
public long? Bytes { get ; set ; }
public int? Attempt { get ; set ; }
public int? Redirects { get ; set ; }
public string Audience { get ; set ; } //public | unlisted | private | none
public string LocalKind { get ; set ; } //person | group | application, only on public and unlisted traffic
public string Inbox { get ; set ; } //shared | personal
public string Signature { get ; set ; } //"cavage:rsa-sha256", "none"
public string ActorHash { get ; set ; } //keyed with that day's salt, never reversible, never linkable across days
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0006", Justification = "Statistics store null rather than an empty list when the activity uses no extension.")]
2026-10-03 10:56:13 +02:00
public List < string > Features { get ; set ; }
public long? AgeSeconds { get ; set ; } //Update and Delete: how old the object was
public bool Crawl { get ; set ; }
}
}