[LNT] r318484 - Store a display name and unit for metrics in the test suite schema
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 16 16:36:32 PST 2017
Author: matze
Date: Thu Nov 16 16:36:31 2017
New Revision: 318484
URL: http://llvm.org/viewvc/llvm-project?rev=318484&view=rev
Log:
Store a display name and unit for metrics in the test suite schema
- Add 'display_name', 'unit', 'unit_abbrev' fields that can be set when
defining test suite metrics.
- Use the new infos in some report pages.
Modified:
lnt/trunk/lnt/server/db/testsuite.py
lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
lnt/trunk/lnt/server/ui/templates/reporting/run_report.txt
lnt/trunk/lnt/server/ui/templates/reporting/runs.html
lnt/trunk/lnt/server/ui/templates/v4_run.html
lnt/trunk/schemas/compile.yaml
lnt/trunk/schemas/nts.yaml
lnt/trunk/tests/server/ui/V4Pages.py
Modified: lnt/trunk/lnt/server/db/testsuite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/testsuite.py?rev=318484&r1=318483&r2=318484&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/testsuite.py (original)
+++ lnt/trunk/lnt/server/db/testsuite.py Thu Nov 16 16:36:31 2017
@@ -147,13 +147,18 @@ class TestSuite(Base):
name = metric_desc['name']
bigger_is_better = metric_desc.get('bigger_is_better', False)
metric_type_name = metric_desc.get('type', 'Real')
+ display_name = metric_desc.get('display_name')
+ unit = metric_desc.get('unit')
+ unit_abbrev = metric_desc.get('unit_abbrev')
if not testsuitedb.is_known_sample_type(metric_type_name):
raise ValueError("Unknown metric type '%s'" %
metric_type_name)
metric_type = SampleType(metric_type_name)
bigger_is_better_int = 1 if bigger_is_better else 0
field = SampleField(name, metric_type, status_field=None,
- bigger_is_better=bigger_is_better_int)
+ bigger_is_better=bigger_is_better_int,
+ display_name=display_name, unit=unit,
+ unit_abbrev=unit_abbrev)
sample_fields.append(field)
ts.sample_fields = sample_fields
ts.jsonschema = data
@@ -265,22 +270,38 @@ class SampleField(FieldMixin, Base):
# This assumption can be inverted by setting this column to nonzero.
bigger_is_better = Column("bigger_is_better", Integer)
- def __init__(self, name, type, status_field=None, bigger_is_better=0):
+ def __init__(self, name, type, status_field=None, bigger_is_better=0,
+ display_name=None, unit=None, unit_abbrev=None):
self.name = name
self.type = type
self.status_field = status_field
self.bigger_is_better = bigger_is_better
+ self.display_name = name if display_name is None else display_name
+ self.unit = unit
+ self.unit_abbrev = unit_abbrev
# Column instance for fields which have been bound (non-DB
# parameter). This is provided for convenience in querying.
self.column = None
+ @sqlalchemy.orm.reconstructor
+ def init_on_load(self):
+ self.display_name = self.name
+ self.unit = None
+ self.unit_abbrev = None
+
def __repr__(self):
return '%s%r' % (self.__class__.__name__, (self.name, self.type, ))
def __copy__(self):
return SampleField(self.name, self.type, self.status_field,
- self.bigger_is_better)
+ self.bigger_is_better, self.display_name, self.unit,
+ self.unit_abbrev)
+
+ def copy_info(self, other):
+ self.display_name = other.display_name
+ self.unit = other.unit
+ self.unit_abbrev = other.unit_abbrev
def _upgrade_to(connectable, tsschema, new_schema, dry_run=False):
@@ -398,6 +419,8 @@ def _sync_fields(session, existing_field
break
if existing is None:
existing_fields.append(new_field.__copy__())
+ elif hasattr(existing, 'copy_info'):
+ existing.copy_info(new_field)
def sync_testsuite_with_metatables(session, testsuite):
Modified: lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html?rev=318484&r1=318483&r2=318484&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html (original)
+++ lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html Thu Nov 16 16:36:31 2017
@@ -233,7 +233,7 @@
{% for field,field_results in report.result_table|reverse %}
{%- if field_results -%}
-<h3>Result Table ({{ field.name }})</h3>
+<h3>Result Table ({{ field.display_name }})</h3>
{{ result_header()+"\n <tbody>" if not report.for_mail }}
{%- for test,visible_results in field_results -%}
{{ result_header()+"\n <tbody>" if report.for_mail }}
@@ -269,7 +269,7 @@
{%- endfor %}
{{ "</tbody></table>" if not report.for_mail }}
{%- else -%}
-<h3>No significant {{ field.name }} changes found.</h3>
+<h3>No significant {{ field.display_name }} changes found.</h3>
{%- endif -%}
{%- endfor -%}
Modified: lnt/trunk/lnt/server/ui/templates/reporting/run_report.txt
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/reporting/run_report.txt?rev=318484&r1=318483&r2=318484&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/run_report.txt (original)
+++ lnt/trunk/lnt/server/ui/templates/reporting/run_report.txt Thu Nov 16 16:36:31 2017
@@ -56,8 +56,7 @@ Total Tests: {{ num_total_tests }}
Run-Over-Run Changes Detail
===========================
{%- for _, field, bucket_name, sorted_bucket, test_names, show_perf in prioritized_buckets_run_over_run %}
- {%- set field_display_name = {"compile_time":"Compile Time", "execution_time":"Execution Time"}.get(field.name, field.name) -%}
- {{ add_report_changes_detail_for_field_and_bucket(show_perf, field_display_name, bucket_name, sorted_bucket, test_names) }}
+ {{ add_report_changes_detail_for_field_and_bucket(show_perf, field.display_name, bucket_name, sorted_bucket, test_names) }}
{%- endfor %}
{%- if baseline %}
@@ -65,10 +64,8 @@ Run-Over-Run Changes Detail
Run-Over-Baseline Changes Detail
================================
{%- for _, field, bucket_name, sorted_bucket, test_names, show_perf in prioritized_buckets_run_over_baseline -%}
- {%- set field_display_name = {"compile_time":"Compile Time",
- "execution_time":"Execution Time"}.get(field.name, field.name) -%}
{{
- add_report_changes_detail_for_field_and_bucket(show_perf, field_display_name,
+ add_report_changes_detail_for_field_and_bucket(show_perf, field.display_name,
bucket_name, sorted_bucket, test_names)
}}
{%- endfor %}
Modified: lnt/trunk/lnt/server/ui/templates/reporting/runs.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/reporting/runs.html?rev=318484&r1=318483&r2=318484&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/runs.html (original)
+++ lnt/trunk/lnt/server/ui/templates/reporting/runs.html Thu Nov 16 16:36:31 2017
@@ -160,10 +160,8 @@
<h3>Run-Over-Run Changes Detail</h3>
{% for _, field, bucket_name, sorted_bucket, test_names, show_perf in prioritized_buckets_run_over_run %}
{% set field_index = ts.get_field_index(field) %}
- {% set field_display_name = {"compile_time":"Compile Time",
- "execution_time":"Execution Time"}.get(field.name, field.name) %}
{{
- add_report_changes_detail_for_field_and_bucket(compare_to, field, show_perf, run_url, field_index, field_display_name,
+ add_report_changes_detail_for_field_and_bucket(compare_to, field, show_perf, run_url, field_index, field.display_name,
bucket_name, sorted_bucket, test_names,
'Previous', '', ' (B)', run_to_baseline_info, styles, classes)
}}
@@ -173,10 +171,8 @@
<h3>Run-Over-Baseline Changes Detail</h3>
{% for _, field, bucket_name, sorted_bucket, test_names, show_perf in prioritized_buckets_run_over_baseline %}
{% set field_index = ts.get_field_index(field) %}
- {% set field_display_name = {"compile_time":"Compile Time",
- "execution_time":"Execution Time"}.get(field.name, field.name) %}
{{
- add_report_changes_detail_for_field_and_bucket(baseline, field, show_perf, run_url, field_index, field_display_name,
+ add_report_changes_detail_for_field_and_bucket(baseline, field, show_perf, run_url, field_index, field.display_name,
bucket_name, sorted_bucket, test_names,
'Baseline', '(B)', '', run_to_run_info, styles, classes)
}}
Modified: lnt/trunk/lnt/server/ui/templates/v4_run.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_run.html?rev=318484&r1=318483&r2=318484&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_run.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_run.html Thu Nov 16 16:36:31 2017
@@ -104,7 +104,7 @@ $('.profile-prev-only').tooltip();
<li><a href="#view_options"><i class="icon-chevron-right"></i>View Options</a></li>
<li><a href="#report"><i class="icon-chevron-right"></i>Report</a></li>
{% for field in metric_fields %}
- <li id="link_{{ field.name }}"><a href="#{{ field.name }}"><i class="icon-chevron-right"></i>{{ field.name }}</a></li>
+ <li id="link_{{ field.name }}"><a href="#{{ field.name }}"><i class="icon-chevron-right"></i>{{ field.display_name }}</a></li>
{% endfor %}
</ul>
@@ -332,7 +332,9 @@ $('.profile-prev-only').tooltip();
{% endif %}
{% endfor %}
{% if tests %}
- {{ utils.render_popup_begin('test_data-' + field.name, field.name, false) }}
+ {% set unit_suffix = ' (%s)' % field.unit if field.unit else '' %}
+ {% set title = field.display_name + unit_suffix %}
+ {{ utils.render_popup_begin('test_data-' + field.name, title, false) }}
<table class="table table-striped table-hover table-condensed floating_header datatable">
<thead>
<tr>
Modified: lnt/trunk/schemas/compile.yaml
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/schemas/compile.yaml?rev=318484&r1=318483&r2=318484&view=diff
==============================================================================
--- lnt/trunk/schemas/compile.yaml (original)
+++ lnt/trunk/schemas/compile.yaml Thu Nov 16 16:36:31 2017
@@ -4,22 +4,32 @@ name: compile
metrics:
- name: user_time
type: Real
+ display_name: User Time
+ unit: seconds
- name: user_status
type: Status
- name: sys_time
type: Real
+ display_name: System Time
+ unit: seconds
- name: sys_status
type: Status
- name: wall_time
type: Real
+ display_name: Wall Time
+ unit: seconds
- name: wall_status
type: Status
- name: size_bytes
type: Real # Should be Integer but we don't want to invalidate old data
+ display_name: Executable Size
+ unit: bytes
- name: size_status
type: Status
- name: mem_bytes
type: Real
+ display_name: Memory Usage
+ unit: bytes
- name: mem_status
type: Status
run_fields:
Modified: lnt/trunk/schemas/nts.yaml
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/schemas/nts.yaml?rev=318484&r1=318483&r2=318484&view=diff
==============================================================================
--- lnt/trunk/schemas/nts.yaml (original)
+++ lnt/trunk/schemas/nts.yaml Thu Nov 16 16:36:31 2017
@@ -6,23 +6,36 @@ name: nts
metrics:
- name: compile_time
type: Real
+ display_name: Compile Time
+ unit: seconds
+ unit_abbrev: s
- name: compile_status
type: Status
- name: execution_time
type: Real
+ display_name: Execution Time
+ unit: seconds
+ unit_abbrev: s
- name: execution_status
type: Status
- name: score
type: Real
bigger_is_better: true
+ display_name: Score
- name: mem_bytes
type: Real
+ display_name: Memory Usage
+ unit: bytes
+ unit_abbrev: b
- name: hash
type: Hash
- name: hash_status
type: Status
- name: code_size
type: Real
+ display_name: Code Size
+ unit: bytes
+ unit_abbrev: b
run_fields:
- name: llvm_project_revision
order: true
Modified: lnt/trunk/tests/server/ui/V4Pages.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/V4Pages.py?rev=318484&r1=318483&r2=318484&view=diff
==============================================================================
--- lnt/trunk/tests/server/ui/V4Pages.py (original)
+++ lnt/trunk/tests/server/ui/V4Pages.py Thu Nov 16 16:36:31 2017
@@ -420,7 +420,7 @@ def main():
# check that a regression seen between 2 consecutive runs that are
# more than a day apart gets reported
result_table_20120504 = get_results_table(
- client, '/v4/nts/daily_report/2012/5/04', "execution_time")
+ client, '/v4/nts/daily_report/2012/5/04', "Execution Time")
check_table_content(result_table_20120504,
[["test1", ""],
["", "machine2", "1.0000", "-", "900.00%", ""],
@@ -434,7 +434,7 @@ def main():
# Check that a failing result does not show up in the spark line
# as a dot with value 0.
result_table_20120513 = get_results_table(
- client, '/v4/nts/daily_report/2012/5/13?num_days=3', "execution_time")
+ client, '/v4/nts/daily_report/2012/5/13?num_days=3', "Execution Time")
check_table_content(result_table_20120513,
[["test6", ""],
["", "machine2", "1.0000", "FAIL", "PASS", ""],
More information about the llvm-commits
mailing list