Commit 22e14426 authored by tonyg@chromium.org's avatar tonyg@chromium.org

[Telemetry] Remove "_by_url" string from page-specific results.

The dashboard no longer needs this hack and in fact it is breaking our ability
to bisect in some cases.

BUG=371159

Review URL: https://codereview.chromium.org/291153008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272079 0039d316-1c4b-4281-b951-d872f2087c98
parent 6ab9d68e
......@@ -77,8 +77,8 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
measurement_results.AddSuccess(test_page_set.pages[1])
measurement_results.PrintSummary()
expected = ['RESULT a_by_url: http___www.bar.com_= 7 seconds',
'RESULT a_by_url: http___www.foo.com_= 3 seconds',
expected = ['RESULT a: http___www.bar.com_= 7 seconds',
'RESULT a: http___www.foo.com_= 3 seconds',
'*RESULT a: a= [3,7] seconds\nAvg a: 5.000000seconds\n' +
'Sd a: 2.828427seconds',
'RESULT telemetry_page_measurement_results: ' +
......@@ -127,13 +127,13 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
measurement_results.AddSuccess(test_page_set.pages[2])
measurement_results.PrintSummary()
expected = ['RESULT a_by_url: http___www.bar.com_= 3 seconds',
'RESULT a_by_url: http___www.baz.com_= 7 seconds',
'RESULT a_by_url: http___www.foo.com_= 3 seconds',
expected = ['RESULT a: http___www.bar.com_= 3 seconds',
'RESULT a: http___www.baz.com_= 7 seconds',
'RESULT a: http___www.foo.com_= 3 seconds',
'*RESULT a: a= [3,3,7] seconds\nAvg a: 4.333333seconds\n' +
'Sd a: 2.309401seconds',
'RESULT b_by_url: http___www.bar.com_= 10 seconds',
'RESULT b_by_url: http___www.foo.com_= 10 seconds',
'RESULT b: http___www.bar.com_= 10 seconds',
'RESULT b: http___www.foo.com_= 10 seconds',
'*RESULT b: b= [10,10] seconds\nAvg b: 10.000000seconds',
'RESULT telemetry_page_measurement_results: ' +
'num_failed= 0 count',
......@@ -157,8 +157,8 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
measurement_results.AddSuccess(test_page_set.pages[1])
measurement_results.PrintSummary()
expected = ['RESULT a_by_url: http___www.bar.com_= 7 seconds',
'RESULT a_by_url: http___www.foo.com_= 3 seconds',
expected = ['RESULT a: http___www.bar.com_= 7 seconds',
'RESULT a: http___www.foo.com_= 3 seconds',
'RESULT telemetry_page_measurement_results: ' +
'num_failed= 1 count',
'RESULT telemetry_page_measurement_results: ' +
......@@ -190,12 +190,12 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
measurement_results.AddSuccess(test_page_set.pages[1])
measurement_results.PrintSummary()
expected = ['RESULT a_by_url: http___www.bar.com_= [7,8] seconds\n' +
'Avg a_by_url: 7.500000seconds\n' +
'Sd a_by_url: 0.707107seconds',
'RESULT a_by_url: http___www.foo.com_= [3,4] seconds\n' +
'Avg a_by_url: 3.500000seconds\n' +
'Sd a_by_url: 0.707107seconds',
expected = ['RESULT a: http___www.bar.com_= [7,8] seconds\n' +
'Avg a: 7.500000seconds\n' +
'Sd a: 0.707107seconds',
'RESULT a: http___www.foo.com_= [3,4] seconds\n' +
'Avg a: 3.500000seconds\n' +
'Sd a: 0.707107seconds',
'RESULT telemetry_page_measurement_results: ' +
'num_failed= 1 count',
'RESULT telemetry_page_measurement_results: ' +
......@@ -228,12 +228,12 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
measurement_results.AddSuccess(test_page_set.pages[1])
measurement_results.PrintSummary()
expected = ['RESULT a_by_url: http___www.bar.com_= [7,8] seconds\n' +
'Avg a_by_url: 7.500000seconds\n' +
'Sd a_by_url: 0.707107seconds',
'RESULT a_by_url: http___www.foo.com_= [3,4] seconds\n' +
'Avg a_by_url: 3.500000seconds\n' +
'Sd a_by_url: 0.707107seconds',
expected = ['RESULT a: http___www.bar.com_= [7,8] seconds\n' +
'Avg a: 7.500000seconds\n' +
'Sd a: 0.707107seconds',
'RESULT a: http___www.foo.com_= [3,4] seconds\n' +
'Avg a: 3.500000seconds\n' +
'Sd a: 0.707107seconds',
'RESULT telemetry_page_measurement_results: ' +
'num_failed= 0 count',
'RESULT telemetry_page_measurement_results: ' +
......@@ -265,12 +265,12 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
measurement_results.AddSuccess(test_page_set.pages[1])
measurement_results.PrintSummary()
expected = ['RESULT a_by_url: http___www.bar.com_= [7,8] seconds\n' +
'Avg a_by_url: 7.500000seconds\n' +
'Sd a_by_url: 0.707107seconds',
'RESULT a_by_url: http___www.foo.com_= [3,4] seconds\n' +
'Avg a_by_url: 3.500000seconds\n' +
'Sd a_by_url: 0.707107seconds',
expected = ['RESULT a: http___www.bar.com_= [7,8] seconds\n' +
'Avg a: 7.500000seconds\n' +
'Sd a: 0.707107seconds',
'RESULT a: http___www.foo.com_= [3,4] seconds\n' +
'Avg a: 3.500000seconds\n' +
'Sd a: 0.707107seconds',
'*RESULT a: a= [3,7,4,8] seconds\n' +
'Avg a: 5.500000seconds\n' +
'Sd a: 2.380476seconds',
......@@ -306,12 +306,12 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
measurement_results.AddSuccess(test_page_set.pages[1])
measurement_results.PrintSummary()
expected = ['RESULT a_by_url: http___www.bar.com_= [7,8] seconds\n' +
'Avg a_by_url: 7.500000seconds\n' +
'Sd a_by_url: 0.707107seconds',
'RESULT a_by_url: http___www.foo.com_= [3,4] seconds\n' +
'Avg a_by_url: 3.500000seconds\n' +
'Sd a_by_url: 0.707107seconds',
expected = ['RESULT a: http___www.bar.com_= [7,8] seconds\n' +
'Avg a: 7.500000seconds\n' +
'Sd a: 0.707107seconds',
'RESULT a: http___www.foo.com_= [3,4] seconds\n' +
'Avg a: 3.500000seconds\n' +
'Sd a: 0.707107seconds',
'*RESULT a: a= [3,4,7,8] seconds\n' +
'Avg a: 5.500000seconds\n' +
'Sd a: 2.380476seconds',
......@@ -376,8 +376,8 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
measurement_results.PrintSummary()
expected = [
'RESULT b_by_url: http___www.foo.com_= [2,3] seconds\n' +
'Avg b_by_url: 2.500000seconds\nSd b_by_url: 0.707107seconds',
'RESULT b: http___www.foo.com_= [2,3] seconds\n' +
'Avg b: 2.500000seconds\nSd b: 0.707107seconds',
'*RESULT b: b= [2,3] seconds\n' +
'Avg b: 2.500000seconds\nSd b: 0.707107seconds',
'*RESULT a: a= 1 seconds',
......@@ -407,8 +407,8 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
self.assertEquals(
measurement_results.results,
['RESULT b_by_url: http___www.bar.com_= 3 seconds',
'RESULT b_by_url: http___www.foo.com_= 2 seconds',
['RESULT b: http___www.bar.com_= 3 seconds',
'RESULT b: http___www.foo.com_= 2 seconds',
'RESULT b: b= [2,3] seconds\n' +
'Avg b: 2.500000seconds\nSd b: 0.707107seconds',
'RESULT a: a= 1 seconds',
......@@ -436,10 +436,10 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
measurement_results.PrintSummary()
expected = [
'RESULT b_by_url: http___www.bar.com_= [3,3] seconds\n' +
'Avg b_by_url: 3.000000seconds',
'RESULT b_by_url: http___www.foo.com_= [2,2] seconds\n' +
'Avg b_by_url: 2.000000seconds',
'RESULT b: http___www.bar.com_= [3,3] seconds\n' +
'Avg b: 3.000000seconds',
'RESULT b: http___www.foo.com_= [2,2] seconds\n' +
'Avg b: 2.000000seconds',
'*RESULT b: b= [2,2,3,3] seconds\nAvg b: 2.500000seconds\n' +
'Sd b: 0.577350seconds',
'*RESULT a: a= [1,1] seconds\nAvg a: 1.000000seconds',
......@@ -468,12 +468,12 @@ class BuildbotPageMeasurementResultsTest(unittest.TestCase):
measurement_results.PrintSummary()
expected = [
'HISTOGRAM a_by_url: http___www.bar.com_= ' +
'HISTOGRAM a: http___www.bar.com_= ' +
'{"buckets": [{"low": 2, "high": 3, "count": 1}]} units\n' +
'Avg a_by_url: 2.500000units',
'HISTOGRAM a_by_url: http___www.foo.com_= ' +
'Avg a: 2.500000units',
'HISTOGRAM a: http___www.foo.com_= ' +
'{"buckets": [{"low": 1, "high": 2, "count": 1}]} units\n' +
'Avg a_by_url: 1.500000units',
'Avg a: 1.500000units',
'RESULT telemetry_page_measurement_results: num_failed= 0 count',
'RESULT telemetry_page_measurement_results: num_errored= 0 count']
self.assertEquals(expected, measurement_results.results)
......@@ -69,7 +69,7 @@ class HtmlPageMeasurementResultsTest(unittest.TestCase):
"units": "count",
"important": False
},
"a_by_url.http://www.bar.com/": {
"a.http://www.bar.com/": {
"current": [7],
"units": "seconds",
"important": False
......@@ -79,7 +79,7 @@ class HtmlPageMeasurementResultsTest(unittest.TestCase):
"units": "count",
"important": False
},
"a_by_url.http://www.foo.com/": {
"a.http://www.foo.com/": {
"current": [3],
"units": "seconds",
"important": False
......@@ -124,7 +124,7 @@ class HtmlPageMeasurementResultsTest(unittest.TestCase):
"units": "count",
"important": False
},
"a_by_url.http://www.bar.com/": {
"a.http://www.bar.com/": {
"current": [7],
"units": "seconds",
"important": False
......@@ -134,7 +134,7 @@ class HtmlPageMeasurementResultsTest(unittest.TestCase):
"units": "count",
"important": False
},
"a_by_url.http://www.foo.com/": {
"a.http://www.foo.com/": {
"current": [3],
"units": "seconds",
"important": False
......@@ -161,7 +161,7 @@ class HtmlPageMeasurementResultsTest(unittest.TestCase):
"units": "count",
"important": False,
},
"a_by_url.http://www.bar.com/": {
"a.http://www.bar.com/": {
"current": [8],
"units": "seconds",
"important": False
......@@ -171,7 +171,7 @@ class HtmlPageMeasurementResultsTest(unittest.TestCase):
"units": "count",
"important": False
},
"a_by_url.http://www.foo.com/": {
"a.http://www.foo.com/": {
"current": [4],
"units": "seconds",
"important": False
......@@ -216,7 +216,7 @@ class HtmlPageMeasurementResultsTest(unittest.TestCase):
"units": "count",
"important": False
},
"a_by_url.http://www.bar.com/": {
"a.http://www.bar.com/": {
"current": [9],
"units": "seconds",
"important": False
......@@ -226,7 +226,7 @@ class HtmlPageMeasurementResultsTest(unittest.TestCase):
"units": "count",
"important": False
},
"a_by_url.http://www.foo.com/": {
"a.http://www.foo.com/": {
"current": [5],
"units": "seconds",
"important": False
......
......@@ -234,8 +234,8 @@ class PageRunnerTests(unittest.TestCase):
self.assertEquals(0, len(results.failures))
with open(output_file) as f:
stdout = f.read()
self.assertIn('RESULT metric_by_url: blank.html= [1,3] unit', stdout)
self.assertIn('RESULT metric_by_url: green_rect.html= [2,4] unit', stdout)
self.assertIn('RESULT metric: blank.html= [1,3] unit', stdout)
self.assertIn('RESULT metric: green_rect.html= [2,4] unit', stdout)
self.assertIn('*RESULT metric: metric= [1,2,3,4] unit', stdout)
finally:
results._output_stream.close() # pylint: disable=W0212
......
......@@ -116,9 +116,8 @@ class Value(object):
raise NotImplementedError()
def GetBuildbotMeasurementAndTraceNameForPerPageResult(self):
measurement, _ = (
_ConvertValueNameToBuildbotChartAndTraceName(self.name))
return measurement + '_by_url', self.page.display_name
measurement, _ = _ConvertValueNameToBuildbotChartAndTraceName(self.name)
return measurement, self.page.display_name
@property
def name_suffix(self):
......
......@@ -26,7 +26,7 @@ class ValueTest(TestBase):
self.assertEquals('default', v.GetBuildbotDataType(
value.COMPUTED_PER_PAGE_SUMMARY_OUTPUT_CONTEXT))
self.assertEquals([3], v.GetBuildbotValue())
self.assertEquals(('x_by_url', page0.display_name),
self.assertEquals(('x', page0.display_name),
v.GetBuildbotMeasurementAndTraceNameForPerPageResult())
v = scalar.ScalarValue(page0, 'x', 'unit', 3, important=False)
......
......@@ -26,7 +26,7 @@ class StringValueTest(TestBase):
self.assertEquals('default', v.GetBuildbotDataType(
value.COMPUTED_PER_PAGE_SUMMARY_OUTPUT_CONTEXT))
self.assertEquals(['L1'], v.GetBuildbotValue())
self.assertEquals(('x_by_url', page0.display_name),
self.assertEquals(('x', page0.display_name),
v.GetBuildbotMeasurementAndTraceNameForPerPageResult())
v = string.StringValue(page0, 'x', 'label', 'L1', important=False)
......
......@@ -78,15 +78,15 @@ class Summary(object):
# Now we have a bunch of values, but there is only one value_name per page.
# Suppose page1 and page2 ran, producing values x and y. We want to print
# x_by_url for page1
# x_by_url for page2
# x for page1
# x for page2
# x for page1, page2 combined
#
# y_by_url for page1
# y_by_url for page2
# y for page1
# y for page2
# y for page1, page2 combined
#
# We already have the x_by_url values in the values array. But, we will need
# We already have the x values in the values array. But, we will need
# them indexable by the value name.
#
# The following dict maps value_name -> list of pages that have values of
......@@ -95,7 +95,7 @@ class Summary(object):
for value in merged_page_values:
per_page_values_by_value_name[value.name].append(value)
# We already have the x_by_url values in the values array. But, we also need
# We already have the x values in the values array. But, we also need
# the values merged across the pages. And, we will need them indexed by
# value name so that we can find them when printing out value names in
# alphabetical order.
......@@ -110,8 +110,8 @@ class Summary(object):
value_names = set([v.name for v in merged_page_values])
sorted_value_names = sorted(value_names)
# Time to walk through the values by name, printing first the by_url values
# and then the merged_site value.
# Time to walk through the values by name, printing first the page-specific
# values and then the merged_site value.
for value_name in sorted_value_names:
per_page_values = per_page_values_by_value_name.get(value_name, [])
......@@ -120,7 +120,7 @@ class Summary(object):
sorted_per_page_values.sort(
key=lambda per_page_values: per_page_values.page.display_name)
# Output the _by_url results.
# Output the page-specific results.
num_successful_pages_for_this_value_name = (
num_successful_pages_for_value_name[value_name])
for per_page_value in sorted_per_page_values:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment