Class AttachmentDerivationBudget
- Namespace
- MailFathom.Application.Emails.AttachmentText.Limits
- Assembly
- MailFathom.Application.dll
What an instance is willing to spend on reading its mail's attachments, and the period it is counted over.
public sealed class AttachmentDerivationBudget
- Inheritance
-
AttachmentDerivationBudget
- Inherited Members
Remarks
The ceilings EmailAttachmentTextBounds does not carry. Those three bound one attachment, one message, and
one account run, which is what keeps any single unit of work small; none of them bounds how much a deployment reads
in a day, because a run that starts with a full budget starts one again on the next interval. These are the
aggregate ceilings that do, and they are the shape EmbeddingSpendBudget already established for embedding:
one for the deployment, which bounds the bill, and one for any single user, so a mailbox full of large attachments
cannot exhaust the window everybody else is working in.
Each step is counted in the unit that fits it rather than in one unit forced on both, which is what AttachmentDerivationStep exists to say: extraction is octets a parser was handed, because a parse is CPU and memory over a byte stream a stranger composed and no character count predicts it, and description is chat calls, because that is what a provider prices. Converting either into the other would produce a number that bounds neither.
The period is the deployment's one budget window — the same length the embedding ceilings are counted over, so an operator reads one roll-over instant rather than three. It is a fixed window anchored at the Unix epoch, so every process and every restart agrees on where a period begins with nothing stored to say so.
Configuration alone, and never part of an embedding profile. A ceiling decides how much of a mailbox gets read and changes the meaning of no stored passage, so raising one re-derives nothing.
Properties
- IsUnbounded
Gets whether this budget refuses nothing at all.
- MaxDescriptionsPerPeriod
Gets the image descriptions one period may ask a provider for in total, or zero where no ceiling was declared.
- MaxDescriptionsPerPeriodPerUser
Gets the image descriptions one period may ask for on behalf of any one user, or zero where none was declared.
- MaxInputOctetsPerPeriod
Gets the octets one period may read out of attachments in total, or zero where no ceiling was declared.
- MaxInputOctetsPerPeriodPerUser
Gets the octets one period may read for any one user, or zero where no per-user ceiling was declared.
- Period
Gets the length of the window every ceiling here is counted over.
- Unbounded
Gets a budget that refuses nothing, over the default window a deployment declaring no period gets.
Methods
- CeilingFor(AttachmentDerivationStep, bool)
Reads the ceiling one step is bounded by, for the deployment or for any one user.
- Create(long, long, long, long, TimeSpan)
Builds a budget from what a deployment declared.
- PeriodStartAt(DateTimeOffset)
Finds the start of the period an instant falls in, which is the key a consumed total is counted under.