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

Unified Diff: telemetry/telemetry/internal/results/csv_pivot_table_output_formatter.py

Issue 2529193002: Support value lists in CSV outputter (Closed)
Patch Set: Created 4 years, 1 month 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: telemetry/telemetry/internal/results/csv_pivot_table_output_formatter.py
diff --git a/telemetry/telemetry/internal/results/csv_pivot_table_output_formatter.py b/telemetry/telemetry/internal/results/csv_pivot_table_output_formatter.py
index 43fb9738be93a7c747300f9dcaf53950f9f28256..65442e7a92cb81299690749385716a3f42f9b6f7 100644
--- a/telemetry/telemetry/internal/results/csv_pivot_table_output_formatter.py
+++ b/telemetry/telemetry/internal/results/csv_pivot_table_output_formatter.py
@@ -5,6 +5,7 @@
import csv
from telemetry.internal.results import output_formatter
+from telemetry.value import list_of_scalar_values
from telemetry.value import scalar
from telemetry.value import trace
@@ -22,7 +23,7 @@ class CsvPivotTableOutputFormatter(output_formatter.OutputFormatter):
If the trace_tag contains a comma, it will be written as several
comma-separated values.
- This class only processes scalar values.
+ This class only processes scalar values and lists of scalar values.
"""
FIELDS = ['story_set', 'page', 'name', 'value', 'units', 'run_index']
@@ -51,11 +52,16 @@ class CsvPivotTableOutputFormatter(output_formatter.OutputFormatter):
'run_index': run_index,
}
for value in run.values:
+ val_string = None
if (isinstance(value, scalar.ScalarValue) or
isinstance(value, trace.TraceValue)):
+ val_string = str(value.value)
+ elif isinstance(value, list_of_scalar_values.ListOfScalarValues):
+ val_string = ' '.join(str(v) for v in value.values)
+ if val_string:
value_dict = {
'name': value.name,
- 'value': value.value,
+ 'value': val_string,
'units': value.units,
}
value_dict.update(page_dict.items())
« 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