Constructor MailAnsweringSpendTracker
- Namespace
- MailFathom.Infrastructure.Observability
- Assembly
- MailFathom.Infrastructure.dll
MailAnsweringSpendTracker(MailAnsweringPeriodBounds, IServiceScopeFactory, TimeProvider, ILogger<MailAnsweringSpendTracker>)
Initializes a tracker over the deployment's ledger, and the instruments it publishes through.
public MailAnsweringSpendTracker(MailAnsweringPeriodBounds bounds, IServiceScopeFactory scopeFactory, TimeProvider timeProvider, ILogger<MailAnsweringSpendTracker> logger)
Parameters
boundsMailAnsweringPeriodBoundsWhat the runs of one period may add up to.
scopeFactoryIServiceScopeFactoryOpens the scope each durable admission and spend is written through.
timeProviderTimeProviderDecides which period an admission or a spend falls in.
loggerILogger<MailAnsweringSpendTracker>Records that a period was spent, in counts alone.
Remarks
The scope factory rather than the store itself, because this is one instance for the process — the instruments below are created once and a second registration of them would publish the same names twice — while the store reaches the database through the scoped session that owns a connection.
Exceptions
- ArgumentNullException
Thrown when an argument is null.