Table of Contents

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

bounds MailAnsweringPeriodBounds

What the runs of one period may add up to.

scopeFactory IServiceScopeFactory

Opens the scope each durable admission and spend is written through.

timeProvider TimeProvider

Decides which period an admission or a spend falls in.

logger ILogger<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.