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

Side by Side Diff: tracing/tracing/metrics/system_health/clock_sync_latency_metric_test.html

Issue 2334233003: Merge NumericValue into Histogram (Closed)
Patch Set: fix rail_power_metric Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2016 The Chromium Authors. All rights reserved. 3 Copyright 2016 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/core/test_utils.html"> 8 <link rel="import" href="/tracing/core/test_utils.html">
9 <link rel="import" href="/tracing/metrics/system_health/clock_sync_latency_metri c.html"> 9 <link rel="import" href="/tracing/metrics/system_health/clock_sync_latency_metri c.html">
10 <link rel="import" href="/tracing/model/model.html"> 10 <link rel="import" href="/tracing/model/model.html">
(...skipping 26 matching lines...) Expand all
37 var winQpcValue = undefined; 37 var winQpcValue = undefined;
38 for (var value of valueSet) { 38 for (var value of valueSet) {
39 if (value.name === battorName) 39 if (value.name === battorName)
40 battorValue = value; 40 battorValue = value;
41 else if (value.name === winQpcName) 41 else if (value.name === winQpcName)
42 winQpcValue = value; 42 winQpcValue = value;
43 } 43 }
44 44
45 assert.isDefined(battorValue); 45 assert.isDefined(battorValue);
46 assert.isDefined(winQpcValue); 46 assert.isDefined(winQpcValue);
47 assert.closeTo(battorValue.numeric.average, 3.0, 1e-5); 47 assert.closeTo(battorValue.average, 3.0, 1e-5);
48 assert.closeTo(winQpcValue.numeric.average, 6.0, 1e-5); 48 assert.closeTo(winQpcValue.average, 6.0, 1e-5);
49 }); 49 });
50 50
51 test('clockSyncLatencyMetric_noTelemetry', function() { 51 test('clockSyncLatencyMetric_noTelemetry', function() {
52 var model = new tr.Model(); 52 var model = new tr.Model();
53 model.clockSyncManager.addClockSyncMarker( 53 model.clockSyncManager.addClockSyncMarker(
54 tr.model.ClockDomainId.TELEMETRY, 'ID01', 1.0, 4.0); 54 tr.model.ClockDomainId.TELEMETRY, 'ID01', 1.0, 4.0);
55 model.clockSyncManager.addClockSyncMarker( 55 model.clockSyncManager.addClockSyncMarker(
56 tr.model.ClockDomainId.BATTOR, 'ID02', 2.5); 56 tr.model.ClockDomainId.BATTOR, 'ID02', 2.5);
57 model.clockSyncManager.addClockSyncMarker( 57 model.clockSyncManager.addClockSyncMarker(
58 tr.model.ClockDomainId.WIN_QPC, 'ID02', 5.0); 58 tr.model.ClockDomainId.WIN_QPC, 'ID02', 5.0);
59 59
60 var valueSet = new tr.v.ValueSet(); 60 var valueSet = new tr.v.ValueSet();
61 tr.metrics.sh.clockSyncLatencyMetric(valueSet, model); 61 tr.metrics.sh.clockSyncLatencyMetric(valueSet, model);
62 62
63 assert.lengthOf(valueSet.valueDicts, 0); 63 assert.lengthOf(valueSet.valueDicts, 0);
64 }); 64 });
65 }); 65 });
66 </script> 66 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698