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

Unified Diff: tracing/tracing/value/chart_json_converter.html

Issue 2924103002: Copy improvement directions from telemetry to legacy_unit_info. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | tracing/tracing/value/chart_json_converter_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/value/chart_json_converter.html
diff --git a/tracing/tracing/value/chart_json_converter.html b/tracing/tracing/value/chart_json_converter.html
index f0c4609cccfb5cd176e77ea3845f626751f5ace1..fee52b3c27d7336f4fa2f5682e47206b79d9f3bb 100644
--- a/tracing/tracing/value/chart_json_converter.html
+++ b/tracing/tracing/value/chart_json_converter.html
@@ -29,11 +29,21 @@ tr.exportTo('tr.v', function() {
const unitInfo = tr.v.LEGACY_UNIT_INFO.get(value.units) || {};
const unitName = unitInfo.name || 'unitlessNumber';
- const unitNameSuffix = tr.b.Unit.nameSuffixForImprovementDirection(
- ChartJsonConverter.convertImprovementDirection(
- value.improvement_direction));
const conversionFactor = unitInfo.conversionFactor || 1;
+ let improvementDirection = tr.b.ImprovementDirection.DONT_CARE;
+ if (unitInfo.defaultImprovementDirection !== undefined) {
+ improvementDirection = unitInfo.defaultImprovementDirection;
+ }
+ // Metrics have the final say.
+ if (value.improvement_direction !== undefined) {
+ improvementDirection =
+ ChartJsonConverter.convertImprovementDirection(
+ value.improvement_direction);
+ }
+ const unitNameSuffix = tr.b.Unit.nameSuffixForImprovementDirection(
+ improvementDirection);
+
const hist = new tr.v.Histogram(
value.name,
tr.b.Unit.byName[unitName + unitNameSuffix],
« no previous file with comments | « no previous file | tracing/tracing/value/chart_json_converter_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698