Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: tracing/tracing/metrics/system_health/hazard_metric.html

Issue 2000063006: Define DiagnosticMap and a basic Diagnostic hierarchy (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tracing/tracing/metrics/system_health/hazard_metric.html
diff --git a/tracing/tracing/metrics/system_health/hazard_metric.html b/tracing/tracing/metrics/system_health/hazard_metric.html
index 26cdc3c5be38f4a9746ed03ca1ca47241928aacc..9ee9103b73ab37b3aa6015f1e6a8959e03baca1d 100644
--- a/tracing/tracing/metrics/system_health/hazard_metric.html
+++ b/tracing/tracing/metrics/system_health/hazard_metric.html
@@ -114,26 +114,14 @@ tr.exportTo('tr.metrics.sh', function() {
// end point (the first contentful paint) while many parts of the page are
// still loading. (There may not necessarily be an Idle after a Load in
// real-world traces, but there almost always is in telemetry.)
- function computeLongIdleTaskHazard(hazardScores, values, ue) {
+ function computeLongIdleTaskHazard(hazardScores, ue) {
var longTaskScores = [];
- var durationValues = new tr.metrics.ValueSet();
findLongTasks(ue).forEach(function(longTask) {
longTaskScores.push(computeResponsivenessRisk(longTask.duration));
- durationValues.addValue(new tr.v.NumericValue(
- ue.parentModel.canonicalUrlThatCreatedThisTrace,
- 'long idle task duration',
- new tr.v.ScalarNumeric(
- timeDurationInMs_smallerIsBetter, longTask.duration),
- {description: 'Duration of a long idle task'}));
});
var options = {description: 'Risk of impacting responsiveness'};
- var groupingKeys = {};
- groupingKeys.userExpectationStableId = ue.stableId;
- groupingKeys.userExpectationStageTitle = ue.stageTitle;
- groupingKeys.userExpectationInitiatorTitle = ue.initiatorTitle;
- var diagnostics = {values: durationValues.valueDicts};
var hazardScore = tr.b.Statistics.weightedMean(
longTaskScores, perceptualBlendSmallerIsBetter);
@@ -142,30 +130,20 @@ tr.exportTo('tr.metrics.sh', function() {
hazardScore = 0;
hazardScores.push(hazardScore);
-
- values.addValue(new tr.v.NumericValue(
- ue.parentModel.canonicalUrlThatCreatedThisTrace,
- 'long idle tasks hazard',
- new tr.v.ScalarNumeric(
- normalizedPercentage_smallerIsBetter, hazardScore),
- options, groupingKeys, diagnostics));
}
function hazardMetric(values, model) {
var hazardScores = [];
- var hazardValues = new tr.metrics.ValueSet();
model.userModel.expectations.forEach(function(ue) {
// Add normalized metrics to diagnostics.values.
// TODO(memory): Add memory here.
if (ue instanceof tr.model.um.IdleExpectation)
- computeLongIdleTaskHazard(hazardScores, hazardValues, ue);
+ computeLongIdleTaskHazard(hazardScores, ue);
});
var options = {description: 'Risk of impacting responsiveness'};
- var groupingKeys = {};
- var diagnostics = {values: hazardValues.valueDicts};
var overallHazard = tr.b.Statistics.weightedMean(
hazardScores, perceptualBlendSmallerIsBetter);
@@ -174,10 +152,9 @@ tr.exportTo('tr.metrics.sh', function() {
overallHazard = 0;
values.addValue(new tr.v.NumericValue(
- model.canonicalUrlThatCreatedThisTrace, 'hazard',
- new tr.v.ScalarNumeric(
+ 'hazard', new tr.v.ScalarNumeric(
normalizedPercentage_smallerIsBetter, overallHazard),
- options, groupingKeys, diagnostics));
+ options));
}
tr.metrics.MetricRegistry.register(hazardMetric);

Powered by Google App Engine
This is Rietveld 408576698