| OLD | NEW |
| 1 <!-- Copyright 2016 The Chromium Authors. All rights reserved. | 1 <!-- Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 Use of this source code is governed by a BSD-style license that can be | 2 Use of this source code is governed by a BSD-style license that can be |
| 3 found in the LICENSE file. | 3 found in the LICENSE file. |
| 4 --> | 4 --> |
| 5 | 5 |
| 6 # How to Write Metrics | 6 # How to Write Metrics |
| 7 | 7 |
| 8 Timeline-Based Measurement v2 is a system for computing metrics from traces. | 8 Timeline-Based Measurement v2 is a system for computing metrics from traces. |
| 9 | 9 |
| 10 A TBM2 metric is a Javascript function that takes a trace Model and produces | 10 A TBM2 metric is a Javascript function that takes a trace Model and produces |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141  | 141  |
| 142 | 142 |
| 143 * [DateRange](/tracing/tracing/value/diagnostics/date_range.html): | 143 * [DateRange](/tracing/tracing/value/diagnostics/date_range.html): |
| 144 This is a Range of Dates. It cannot be empty, but the minDate could be the | 144 This is a Range of Dates. It cannot be empty, but the minDate could be the |
| 145 same as the maxDate. Telemetry automatically adds 2 shared DateRanges to all | 145 same as the maxDate. Telemetry automatically adds 2 shared DateRanges to all |
| 146 results: 'benchmarkStart' and 'traceStart'. | 146 results: 'benchmarkStart' and 'traceStart'. |
| 147 | 147 |
| 148  | 148  |
| 149 | 149 |
| 150 ### Histogram Relationship Diagnostics | |
| 151 | 150 |
| 152 * [RelatedHistogramMap](/tracing/tracing/value/diagnostics/related_histogram_ma
p.html): | 151 ### Related Histogram Name Map |
| 153 These are Maps from strings to references to other Histograms. Visually, they | |
| 154 are a set of HTML links where the text content of the link is the Map's | |
| 155 string key instead of the Histogram's name. One example application is when a | |
| 156 Histogram was produced not directly by a metric, but rather by merging | |
| 157 together other Histograms, then it will have a RelatedHistogramMap named | |
| 158 'mergedFrom' that refers to the Histograms that were merged by their grouping | |
| 159 key, e.g. the telemetry story name. | |
| 160 | 152 |
| 161  | 153 * [RelatedNameMap](/tracing/tracing/value/diagnostics/related_name_map.html): |
| 162 | 154 This maps from short keys to Histogram name. These are correlated with |
| 163 * [RelatedHistogramBreakdown](/tracing/tracing/value/diagnostics/related_histog
ram_breakdown.html): | 155 Breakdowns. They are visualized as HTML links. |
| 164 Structurally, this is a RelatedHistogramMap, but conceptually and visually, t
his | |
| 165 is a Breakdown. Whereas Breakdown's stacked bar chart derives its data from | |
| 166 the numbers contained explicitly in the Breakdown, a | |
| 167 RelatedHistogramBreakdown's stacked | |
| 168 bar chart derives its data from the referenced Histograms' sums. | |
| 169 | |
| 170  | |
| 171 | 156 |
| 172 | 157 |
| 173 ### Other Diagnostics | 158 ### Other Diagnostics |
| 174 | 159 |
| 175 * [Scalar](/tracing/tracing/value/diagnostics/scalar.html): | 160 * [Scalar](/tracing/tracing/value/diagnostics/scalar.html): |
| 176 Metrics must not use this, since it is incapable of being merged. It is | 161 Metrics must not use this, since it is incapable of being merged. It is |
| 177 mentioned here for completeness. It wraps a Scalar, which is just a | 162 mentioned here for completeness. It wraps a Scalar, which is just a |
| 178 unitted number. This is only to allow Histograms in other parts of the trace | 163 unitted number. This is only to allow Histograms in other parts of the trace |
| 179 viewer to display number sample diagnostics more intelligently than | 164 viewer to display number sample diagnostics more intelligently than |
| 180 GenericSet can. If a metric wants to display number sample diagnostics | 165 GenericSet can. If a metric wants to display number sample diagnostics |
| 181 intelligently, then it should use RelatedHistogramMap; if it does not want to | 166 intelligently, then it should use Breakdown; if it does not want to |
| 182 monitor changes in those numbers, then the TBM2 maintainers can add a | 167 monitor changes in those numbers, then the TBM2 maintainers can add a |
| 183 HistogramDiagnostic that supports merging. | 168 HistogramDiagnostic that supports merging. |
| 184 | 169 |
| 185 | 170 |
| 186 ### Reserved Names | 171 ### Reserved Names |
| 187 | 172 |
| 188 Metrics may not use the following names for Histogram-level Diagnostics. | 173 Metrics may not use the following names for Histogram-level Diagnostics. |
| 189 | 174 |
| 190 * angleRevisions is a GenericSet of strings containing | 175 * angleRevisions is a GenericSet of strings containing |
| 191 [Angle](https://chromium.googlesource.com/angle/angle/) git hashes. | 176 [Angle](https://chromium.googlesource.com/angle/angle/) git hashes. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 * Instead of having one category for all story grouping keys, each grouping | 279 * Instead of having one category for all story grouping keys, each grouping |
| 295 individual grouping key may be listed as a category. For example, in Page | 280 individual grouping key may be listed as a category. For example, in Page |
| 296 Cycler v2 benchmarks, the "cache_temperature" grouping key would be | 281 Cycler v2 benchmarks, the "cache_temperature" grouping key would be |
| 297 displayed as a category. | 282 displayed as a category. |
| 298 * Choosing groups builds a hierarchy of histograms that is filled in by merging | 283 * Choosing groups builds a hierarchy of histograms that is filled in by merging |
| 299 histograms from the bottom up. Expanding the rows of histogram-set-table, any | 284 histograms from the bottom up. Expanding the rows of histogram-set-table, any |
| 300 leaf nodes are histograms that were loaded, and their ancestors are computed b
y | 285 leaf nodes are histograms that were loaded, and their ancestors are computed b
y |
| 301 merging. | 286 merging. |
| 302 * histogram-set-table uses the "label" HistogramGrouping to define the columns | 287 * histogram-set-table uses the "label" HistogramGrouping to define the columns |
| 303 of the table. | 288 of the table. |
| OLD | NEW |