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

Unified Diff: tracing/tracing/metrics/tracing_metric.html

Issue 2700163002: Make some small style cleanups in tracing_metric.html (Closed)
Patch Set: Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/metrics/tracing_metric.html
diff --git a/tracing/tracing/metrics/tracing_metric.html b/tracing/tracing/metrics/tracing_metric.html
index 21866bcc91a700e12d7145668cb16799f4893203..12753b67be98c1ea0dc4411973ab7074911d14f0 100644
--- a/tracing/tracing/metrics/tracing_metric.html
+++ b/tracing/tracing/metrics/tracing_metric.html
@@ -38,17 +38,16 @@ tr.exportTo('tr.metrics', function() {
function addMemoryInfraHistograms(
histograms, model, categoryNamesToTotalEventSizes) {
var memoryDumpCount = model.globalMemoryDumps.length;
- if (memoryDumpCount === 0)
- return;
+ if (memoryDumpCount === 0) return;
var totalOverhead = 0;
var nonMemoryInfraThreadOverhead = 0;
var overheadByProvider = {};
- tr.b.iterItems(model.processes, function(pid, process) {
- tr.b.iterItems(process.threads, function(tid, thread) {
- tr.b.iterItems(thread.sliceGroup.slices, (unusedSliceId, slice) => {
- if (slice.category !== MEMORY_INFRA_TRACING_CATEGORY)
- return;
+ for (var process of Object.values(model.processes)) {
+ for (var thread of Object.values(process.threads)) {
+ for (var slice of Object.values(thread.sliceGroup.slices)) {
+ if (slice.category !== MEMORY_INFRA_TRACING_CATEGORY) return;
+
totalOverhead += slice.duration;
if (thread.name !== 'MemoryInfra')
nonMemoryInfraThreadOverhead += slice.duration;
@@ -62,9 +61,9 @@ tr.exportTo('tr.metrics', function() {
durationAndCount.duration += slice.duration;
durationAndCount.count++;
}
- });
- });
- });
+ }
+ }
+ }
addTimeDurationHistogram(
'memory_dump_cpu_overhead',
@@ -75,12 +74,12 @@ tr.exportTo('tr.metrics', function() {
nonMemoryInfraThreadOverhead / memoryDumpCount, histograms,
'Average CPU overhead on non-memory-infra threads per memory-infra ' +
'dump');
- tr.b.iterItems(overheadByProvider, function(providerName, overhead) {
+ for (let [providerName, overhead] of Object.entries(overheadByProvider)) {
addTimeDurationHistogram(
providerName + '_memory_dump_cpu_overhead',
overhead.duration / overhead.count, histograms,
'Average CPU overhead of ' + providerName + ' per OnMemoryDump call');
- });
+ }
var memoryInfraEventsSize =
categoryNamesToTotalEventSizes.get(MEMORY_INFRA_TRACING_CATEGORY);
@@ -113,12 +112,10 @@ tr.exportTo('tr.metrics', function() {
if (!model.stats.hasEventSizesinBytes) return;
var eventStats = model.stats.allTraceEventStatsInTimeIntervals;
- eventStats.sort(function(a, b) {
- return a.timeInterval - b.timeInterval;
- });
+ eventStats.sort((a, b) => a.timeInterval - b.timeInterval);
- var totalTraceBytes = eventStats.reduce((a, b) =>
- (a + b.totalEventSizeinBytes), 0);
+ var totalTraceBytes = eventStats.reduce(
+ (a, b) => a + b.totalEventSizeinBytes, 0);
// We maintain a sliding window of records [start ... end-1] where end
// increments each time through the loop, and we move start just far enough
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698