Commit 1a3e5a0
committed
Gate any metric of any grid point, and let every matching threshold fire
A threshold gated one thing: the `value` scalar of every grid point of its
measure. A benchmark now reports as many grid points as it has parameter sets and
as many named scalars as its harness measured, and neither was addressable. A
project that wanted `p99` watched on the one configuration where it matters had
nowhere to say so.
A threshold gains two optional fields. `metric` is the name it gates, and a
threshold that names none gates the conventional `value` name: a threshold always
gates exactly one name and a bare one never gates all of them. `parameters` is a
filter over grid points, a list of parameter sets that is an OR across the list
and a subset match within each set, and a threshold with no filter gates every
grid point. Both defaults are what every existing threshold already does, so no
existing row moves and no project's alert volume changes.
Every threshold that matches a metric row runs. There is no winner: not in
gating, not in display. A grid point that a bare threshold and a filtered
threshold both match earns a boundary from each and, on a regression, an alert
from each. That is the design and it is pinned by a test, because a row that two
people asked to be watched is a row two people hear about.
Identity is the three dimensions plus the two new fields, under the null
semantics they carry. SQLite treats nulls as distinct in a unique index, so two
bare thresholds on one branch, testbed, and measure would no longer collide under
a plain unique key over the five columns. The key is declared over the effective
values instead, `COALESCE(metric, 'value')` and `COALESCE(parameters, x'')`, and
the wire canonicalizes into them: an explicit `value` and an absent name are one
threshold, an empty filter and an absent one are one threshold, and a filter has
one spelling because its sets sort by their RFC 8785 canonical bytes and
duplicates collapse.
A threshold gates the sample it names. The historical query behind detection
filters on the threshold's metric name, so a threshold on `p99` is tested against
`p99` rows and never against the `value` rows beside them, and the per grid point
separation stays exactly as it was.
`boundary` keys on `(metric_id, threshold_id)` rather than on `metric_id` alone,
because a metric row may now carry a boundary per threshold that gated it. Both
tables are rebuilt with their unique keys built after the copy, which is what
keeps the rebuild at the cost of the scan.
`JsonAlert` gains `value`, the scalar the alert fired on, and its `metric` triple
becomes optional: the triple is a convention over the `value` name, so an alert
on any other name has none. Every alert that a threshold could raise before this
carries the triple exactly as it did. The gated name is readable at
`alert.threshold.metric`.
The deprecated singular `threshold`, `boundary`, and `alert` fields carry the
bare threshold's gate and no other's, everywhere they appear. That is precisely
what a caller from before named gating has always been shown: a row that only a
named or filtered threshold gates reports no gate in them at all. Where a list of
boundaries is returned, it is ordered by threshold creation time, oldest first,
with the UUID breaking a tie.
The in-report `thresholds.models` map is unchanged and still addresses the bare
threshold: a map that names a measure and a model says nothing about a name or a
grid point, so it neither creates nor resets anything narrower.1 parent 96aae30 commit 1a3e5a0
30 files changed
Lines changed: 2592 additions & 270 deletions
File tree
- lib
- api_projects
- src
- perf
- tests
- bencher_comment/src
- bencher_json/src
- project
- parameter
- bencher_schema
- migrations/2026-08-26-130000_threshold_metric_parameters
- src
- model/project
- report
- results
- detector
- threshold
- plus/api_mcp/src/tools
- services
- api
- cli/src/bencher/sub/project/threshold
- console
- src
- components/console/deck/hand/card
- config/project
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
185 | | - | |
186 | 187 | | |
187 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
188 | 192 | | |
189 | 193 | | |
190 | 194 | | |
| |||
224 | 228 | | |
225 | 229 | | |
226 | 230 | | |
227 | | - | |
228 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
229 | 234 | | |
230 | 235 | | |
231 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
232 | 256 | | |
233 | 257 | | |
234 | 258 | | |
| |||
255 | 279 | | |
256 | 280 | | |
257 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
258 | 290 | | |
259 | 291 | | |
260 | 292 | | |
| |||
263 | 295 | | |
264 | 296 | | |
265 | 297 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
275 | 308 | | |
276 | 309 | | |
277 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
| 544 | + | |
| 545 | + | |
544 | 546 | | |
545 | 547 | | |
546 | 548 | | |
547 | 549 | | |
548 | | - | |
549 | 550 | | |
550 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
551 | 555 | | |
552 | 556 | | |
553 | 557 | | |
| |||
686 | 690 | | |
687 | 691 | | |
688 | 692 | | |
| 693 | + | |
689 | 694 | | |
690 | 695 | | |
691 | 696 | | |
| |||
747 | 752 | | |
748 | 753 | | |
749 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
750 | 758 | | |
751 | 759 | | |
752 | 760 | | |
| |||
764 | 772 | | |
765 | 773 | | |
766 | 774 | | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
767 | 794 | | |
768 | 795 | | |
769 | 796 | | |
770 | 797 | | |
771 | 798 | | |
772 | 799 | | |
773 | | - | |
| 800 | + | |
774 | 801 | | |
775 | 802 | | |
776 | 803 | | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
| 804 | + | |
783 | 805 | | |
784 | 806 | | |
785 | 807 | | |
| |||
797 | 819 | | |
798 | 820 | | |
799 | 821 | | |
800 | | - | |
| 822 | + | |
| 823 | + | |
801 | 824 | | |
802 | 825 | | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
803 | 834 | | |
804 | 835 | | |
805 | 836 | | |
| |||
811 | 842 | | |
812 | 843 | | |
813 | 844 | | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
| 845 | + | |
818 | 846 | | |
819 | 847 | | |
820 | 848 | | |
| |||
837 | 865 | | |
838 | 866 | | |
839 | 867 | | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
849 | 874 | | |
850 | 875 | | |
851 | 876 | | |
852 | | - | |
853 | | - | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
854 | 882 | | |
855 | 883 | | |
856 | 884 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| |||
247 | 250 | | |
248 | 251 | | |
249 | 252 | | |
250 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
251 | 258 | | |
252 | 259 | | |
253 | 260 | | |
| |||
307 | 314 | | |
308 | 315 | | |
309 | 316 | | |
310 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
311 | 324 | | |
312 | 325 | | |
313 | 326 | | |
314 | | - | |
315 | | - | |
316 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
317 | 333 | | |
318 | 334 | | |
319 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
887 | 891 | | |
888 | 892 | | |
889 | | - | |
| 893 | + | |
890 | 894 | | |
891 | 895 | | |
892 | 896 | | |
| |||
0 commit comments