Documentation
¶
Overview ¶
Package allocguard reports a failed allocation guard in words that say what to do.
The guards (the tests named Test...AllocationsBudget) hold the number of allocations of each path to its budget. The budget is the figure that was measured, and a figure up to 10% above it passes (one more for a budget under 10): only a figure above that fails the row, and the message says how to find the new allocation. A figure that fell passes, and when it fell by more than 10% the test logs a hint to lower the budget.
Index ¶
Constants ¶
const Docs = "docs/dev/performance.md#allocation-guard"
Docs is the page and the section that describe the guard and how to update a budget.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert fails the test when the measured figure of a path is more than 10% above its budget (see Message), and logs the Hint when it is more than 10% below.
func Hint ¶
Hint is the advice to lower the budget of a row whose figure fell by more than 10%, or "" for any other figure.
func Message ¶
Message is the failure text of a row, or "" when the measured figure is at most 10% above the budget. The text names the path, the budget and the measured figure, says that the figure ROSE, and how to find the allocation. The test is the name of the test that holds the row (t.Name() of the top-level test).
Types ¶
This section is empty.