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

Unified Diff: tracing/tracing/value/diagnostics/telemetry_info.html

Issue 2982283002: Delete TelemetryInfo, MergedTelemetryInfo diagnostics. (Closed)
Patch Set: rebase Created 3 years, 4 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 | « tracing/tracing/value/diagnostics/reserved_names.html ('k') | tracing/tracing/value/histogram.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/value/diagnostics/telemetry_info.html
diff --git a/tracing/tracing/value/diagnostics/telemetry_info.html b/tracing/tracing/value/diagnostics/telemetry_info.html
deleted file mode 100644
index f6371794f134dd7fce8168615e5808130693b02c..0000000000000000000000000000000000000000
--- a/tracing/tracing/value/diagnostics/telemetry_info.html
+++ /dev/null
@@ -1,212 +0,0 @@
-<!DOCTYPE html>
-<!--
-Copyright 2016 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="/tracing/base/utils.html">
-<link rel="import" href="/tracing/value/diagnostics/diagnostic.html">
-
-<script>
-'use strict';
-
-tr.exportTo('tr.v.d', function() {
- class TelemetryInfo extends tr.v.d.Diagnostic {
- constructor(opt_info) {
- super();
-
- this.benchmarkName_ = '';
- this.benchmarkStart_ = undefined;
- this.label_ = '';
- this.legacyTIRLabel_ = '';
- this.storyDisplayName_ = '';
- this.storyGroupingKeys_ = new Map();
- this.storysetRepeatCounter_ = undefined;
- this.canonicalUrl_ = '';
-
- if (opt_info) {
- this.addInfo(opt_info);
- }
- }
-
- clone() {
- const clone = new tr.v.d.MergedTelemetryInfo();
- clone.addDiagnostic(this);
- return clone;
- }
-
- /**
- * @param {!Object} info
- * @param {string} info.benchmarkName
- * @param {undefined|string} info.label
- * @param {undefined|!Object} info.storyGroupingKeys
- * @param {undefined|string} info.storyDisplayName
- * @param {number} info.storysetRepeatCounter
- * @param {number} info.benchmarkStartMs Milliseconds since Unix epoch.
- */
- addInfo(info) {
- if (info.benchmarkName) {
- this.benchmarkName_ = info.benchmarkName;
- }
- if (info.benchmarkStartMs !== undefined) {
- this.benchmarkStart_ = new Date(info.benchmarkStartMs);
- }
- if (info.label) {
- this.label_ = info.label;
- }
- if (info.storyDisplayName) {
- this.storyDisplayName_ = info.storyDisplayName;
- }
- for (const [name, value] of Object.entries(
- info.storyGroupingKeys || {})) {
- this.storyGroupingKeys_.set(name, value);
- }
- if (info.storysetRepeatCounter !== undefined) {
- this.storysetRepeatCounter_ = info.storysetRepeatCounter;
- }
- if (info.legacyTIRLabel) {
- this.legacyTIRLabel_ = info.legacyTIRLabel;
- }
- if (info.canonicalUrl) {
- this.canonicalUrl_ = info.canonicalUrl;
- }
- }
-
- addToHistogram(hist) {
- hist.diagnostics.set(tr.v.d.RESERVED_NAMES.TELEMETRY, this);
- }
-
- /**
- * @param {!tr.v.Histogram} hist
- * @return {(undefined|!tr.v.d.TelemetryInfo)}
- */
- static getFromHistogram(hist) {
- return hist.diagnostics.get(tr.v.d.RESERVED_NAMES.TELEMETRY) ||
- hist.diagnostics.get(tr.v.d.RESERVED_NAMES.ITERATION);
- }
-
- asDictInto_(d) {
- d.benchmarkName = this.benchmarkName;
- if (this.benchmarkStart) {
- d.benchmarkStartMs = this.benchmarkStart.getTime();
- }
- d.label = this.label;
- d.storyDisplayName = this.storyDisplayName;
- if (this.storyGroupingKeys.size > 0) {
- d.storyGroupingKeys = {};
- for (const [name, value] of this.storyGroupingKeys) {
- d.storyGroupingKeys[name] = value;
- }
- }
- d.storysetRepeatCounter = this.storysetRepeatCounter;
- d.legacyTIRLabel = this.legacyTIRLabel;
- d.canonicalUrl = this.canonicalUrl;
- }
-
- static fromDict(d) {
- const info = new TelemetryInfo();
- info.addInfo(d);
- return info;
- }
-
- get displayLabel() {
- if (this.label) return this.label;
- return this.benchmarkName + '\n' + this.benchmarkStartString;
- }
-
- get benchmarkName() {
- return this.benchmarkName_;
- }
-
- get label() {
- return this.label_;
- }
-
- get legacyTIRLabel() {
- return this.legacyTIRLabel_;
- }
-
- set legacyTIRLabel(tir) {
- this.legacyTIRLabel_ = tir;
- }
-
- get storyGroupingKeys() {
- return this.storyGroupingKeys_;
- }
-
- get storyDisplayName() {
- return this.storyDisplayName_;
- }
-
- get storysetRepeatCounter() {
- return this.storysetRepeatCounter_;
- }
-
- get storysetRepeatCounterLabel() {
- return 'storyset repeat ' + this.storysetRepeatCounter;
- }
-
- get canonicalUrl() {
- return this.canonicalUrl_;
- }
-
- get benchmarkStart() {
- return this.benchmarkStart_;
- }
-
- get benchmarkStartString() {
- if (this.benchmarkStart_ === undefined) return '';
- return tr.b.formatDate(this.benchmarkStart);
- }
-
- /**
- * @param {!tr.v.Histogram} hist
- * @param {string} fieldName
- * @param {*} defaultValue
- * @return {*}
- */
- static getField(hist, fieldName, defaultValue) {
- const telemetry = tr.v.d.TelemetryInfo.getFromHistogram(hist);
- if (!(telemetry instanceof tr.v.d.TelemetryInfo) ||
- !telemetry[fieldName]) {
- return defaultValue;
- }
- return telemetry[fieldName];
- }
-
- /**
- * @param {!tr.v.Histogram} hist
- * @param {string} storyGroupingKey
- * @return {string}
- */
- static getStoryGroupingKeyLabel(hist, storyGroupingKey) {
- const telemetry = tr.v.d.TelemetryInfo.getFromHistogram(hist);
- if (!(telemetry instanceof tr.v.d.TelemetryInfo)) {
- return storyGroupingKey + ': undefined';
- }
- return storyGroupingKey + ': ' +
- telemetry.storyGroupingKeys.get(storyGroupingKey);
- }
-
- /**
- * Returns a closure that gets a story grouping key label from a Histogram.
- *
- * @param {string} storyGroupingKey
- * @return {!function(tr.v.Histogram):string}
- */
- static makeStoryGroupingKeyLabelGetter(storyGroupingKey) {
- return v => TelemetryInfo.getStoryGroupingKeyLabel(
- v, storyGroupingKey);
- }
- }
-
- tr.v.d.Diagnostic.register(TelemetryInfo, {
- elementName: 'tr-v-ui-telemetry-info-span'
- });
-
- return {
- TelemetryInfo,
- };
-});
-</script>
« no previous file with comments | « tracing/tracing/value/diagnostics/reserved_names.html ('k') | tracing/tracing/value/histogram.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698