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

Unified Diff: perf_insights/perf_insights/mappers/trace_stats.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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: perf_insights/perf_insights/mappers/trace_stats.html
diff --git a/perf_insights/perf_insights/mappers/trace_stats.html b/perf_insights/perf_insights/mappers/trace_stats.html
deleted file mode 100644
index b1e3ea840b145d7bc1174c175f493df851b64a49..0000000000000000000000000000000000000000
--- a/perf_insights/perf_insights/mappers/trace_stats.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!DOCTYPE html>
-<!--
-Copyright 2015 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
--->
-
-<link rel="import" href="/perf_insights/mre/function_handle.html">
-<link rel="import" href="/tracing/base/range.html">
-<link rel="import" href="/tracing/value/numeric.html">
-<link rel="import" href="/tracing/value/unit.html">
-
-<script>
-'use strict';
-
-tr.exportTo('pi.m', function() {
- var COUNT_NUMERIC_BUILDER = tr.v.NumericBuilder.createLinear(
- tr.v.Unit.byName.unitlessNumber, tr.b.Range.fromExplicitRange(0, 50000),
- 20);
-
- function traceStatsFunction(result, model) {
- var canonicalUrl = model.canonicalUrl;
- var eventCount = 0;
- var firstTime = Number.MAX_VALUE;
- var lastTime = 0;
- var categories = {};
-
- var seconds_counts = {};
- model.iterateAllEvents(function(event) {
- eventCount += 1;
- if (event.start < firstTime)
- firstTime = event.start;
-
- var eventEnd = event.start + event.duration;
- if (eventEnd > lastTime)
- lastTime = eventEnd;
-
- if (categories[event.category] === undefined)
- categories[event.category] = 0;
-
- categories[event.category]++;
-
- var second = Math.round(event.start / 1000);
- if (seconds_counts[second] === undefined)
- seconds_counts[second] = 0;
-
- seconds_counts[second]++;
- });
-
- var histogram = COUNT_NUMERIC_BUILDER.build();
-
- for (var second in seconds_counts)
- histogram.add(seconds_counts[second]);
-
- var stats = {
- totalEvents: eventCount,
- firstTimeInMS: firstTime,
- lastTimeInMS: lastTime,
- durationInMS: lastTime - firstTime,
- eventsPerSecond: eventCount / (lastTime - firstTime) * 1000,
- categories: categories,
- events_seconds: histogram.asDict()
- };
-
- result.addPair('stats', stats);
- }
-
- pi.FunctionRegistry.register(traceStatsFunction);
-
- //Exporting for tests.
- return {
- traceStatsFunctionForTest: traceStatsFunction
- };
-});
-</script>

Powered by Google App Engine
This is Rietveld 408576698