THPDFParserBudgetStatistics Record
Reports parser budget limits, token totals, peaks, breaches and session validity
Declaration
THPDFParserBudgetStatistics= record
MaxTokenBytes: Integer;
MaxTotalTokens: Int64;
MaxContainerItems: Integer;
MaxBadTokens: Integer;
TokenCount: Int64;
BadTokenCount: Int64;
PeakTokenBytes: Integer;
PeakContainerItems: Integer;
LimitBreachCount: Int64;
LastLimit: THPDFParserBudgetLimit;
LastObserved: Int64;
LastMaximum: Int64;
Exceeded: boolean;
Valid: boolean;
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
MaxTokenBytes | Configured cap on the total token bytes for the session |
MaxTotalTokens | Configured cap on the number of tokens that may be scanned |
MaxContainerItems | Configured cap on items inside a single array or dictionary container |
MaxBadTokens | Configured cap on malformed tokens that may be tolerated per session |
TokenCount | Tokens consumed so far within the session |
BadTokenCount | Malformed tokens met with so far |
PeakTokenBytes | Largest single token byte size seen so far |
PeakContainerItems | Largest container item count seen so far |
LimitBreachCount | Number of times any budget limit was struck during the session |
LastLimit | Which limit kind produced the latest breach (THPDFParserBudgetLimit) |
LastObserved | Observed value of the latest breach |
LastMaximum | Configured maximum of the latest breach |
Exceeded | True once any limit has been overstepped and the load was abandoned |
Valid | True whilst a budget-tracked parser session is active; GetLastParserBudgetStatistics hands back this value |
Usage notes
- Read the snapshot with
GetLastParserBudgetStatistics, which returns the value ofValidso that callers can spot a session that never started - On
Exceeded,LastLimit,LastObservedandLastMaximumidentify the exact rule that tripped, mirroring the fields ofEHPDFParserBudgetExceeded - All counters reset once a new parser budget session begins, so the record always describes the latest load