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

Unified Diff: tracing/tracing/value/ui/numeric_stats_span.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: tracing/tracing/value/ui/numeric_stats_span.html
diff --git a/tracing/tracing/value/ui/numeric_stats_span.html b/tracing/tracing/value/ui/numeric_stats_span.html
new file mode 100644
index 0000000000000000000000000000000000000000..9710ce0aa465dcb1c4085bb583fec8e92340a2d3
--- /dev/null
+++ b/tracing/tracing/value/ui/numeric_stats_span.html
@@ -0,0 +1,64 @@
+<!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/ui/base/table.html">
+<link rel="import" href="/tracing/value/ui/scalar_span.html">
+
+<dom-module name="tr-v-ui-numeric-stats-span">
+ <template>
+ <tr-ui-b-table id="stats"></tr-ui-b-table>
+ </template>
+</dom-module>
+<script>
+'use strict';
+Polymer({
+ is: 'tr-v-ui-numeric-stats-span',
+
+ ready: function() {
+ this.numeric_ = undefined;
+
+ this.$.stats.showHeader = false;
+ this.$.stats.tableColumns = [
+ {
+ value: function(row) {
+ return row.name;
+ }
+ },
+ {
+ align: tr.ui.b.TableFormat.ColumnAlignment.RIGHT,
+ value: function(row) {
+ return tr.v.ui.createScalarSpan(row.value);
+ }
+ }
+ ];
+ },
+
+ get numeric() {
+ return this.numeric_;
+ },
+
+ set numeric(n) {
+ this.numeric_ = n;
+ this.updateContents_();
+ },
+
+ updateContents_: function() {
+ var rows = [];
+ if (this.numeric_) {
+ var stats = this.numeric_.getSummarizedScalarNumericsWithNames();
+ stats.forEach(function(stat) {
+ rows.push({
+ name: stat.name,
+ value: stat.scalar
+ });
+ });
+ }
+ this.$.stats.tableRows = rows;
+ this.$.stats.rebuild();
+ }
+});
+</script>
« no previous file with comments | « tracing/tracing/value/ui/iteration_info_span.html ('k') | tracing/tracing/value/ui/numeric_stats_span_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698