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 total token bytes for the session |
MaxTotalTokens | Configured cap on the number of tokens scanned |
MaxContainerItems | Configured cap on items inside one array or dictionary container |
MaxBadTokens | Configured cap on malformed tokens tolerated per session |
TokenCount | Tokens consumed so far in the session |
BadTokenCount | Malformed tokens encountered so far |
PeakTokenBytes | Largest single token byte size observed |
PeakContainerItems | Largest container item count observed |
LimitBreachCount | Number of times any budget limit was hit during the session |
LastLimit | Which limit kind produced the most recent breach (THPDFParserBudgetLimit) |
LastObserved | Observed value of the most recent breach |
LastMaximum | Configured maximum of the most recent breach |
Exceeded | True once any limit has been exceeded and the load was aborted |
Valid | True while a budget-tracked parser session is active; GetLastParserBudgetStatistics returns this value |
Usage notes
- Read the snapshot with
GetLastParserBudgetStatistics, which returns the value ofValidso callers can detect a session that never started - On
Exceeded,LastLimit,LastObserved, andLastMaximumidentify the exact rule that tripped, mirroring the fields ofEHPDFParserBudgetExceeded - All counters reset when a new parser budget session begins, so the record always describes the most recent load