[LNT] r312314 - Graph for sample API: Fixes the way field_index is generated for a given field_name.
Leandro Nunes via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 1 01:36:52 PDT 2017
Author: leandron
Date: Fri Sep 1 01:36:52 2017
New Revision: 312314
URL: http://llvm.org/viewvc/llvm-project?rev=312314&view=rev
Log:
Graph for sample API: Fixes the way field_index is generated for a given field_name.
Modified:
lnt/trunk/lnt/server/ui/views.py
Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=312314&r1=312313&r2=312314&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Fri Sep 1 01:36:52 2017
@@ -699,14 +699,13 @@ def v4_graph_for_sample(sample_id, field
abort(404, "Could not find sample id: {}".format(sample_id))
# Get the field index we are interested in.
- field = None
- for f in target_sample.get_primary_fields():
+ field_index = None
+ for idx, f in enumerate(ts.sample_fields):
if f.name == field_name:
- field = f
+ field_index = idx
break
- if not field:
+ if field_index is None:
abort(400, "Could not find field {}".format(field_name))
- field_index = field.index
kwargs = {'plot.0': '{machine_id}.{test_id}.{field_id}'.format(
machine_id=target_sample.run.machine.id,
More information about the llvm-commits
mailing list