<div dir="ltr">How useful is it to know the date a sample was taken?<div><br></div><div>I'm a little concerned with how unwieldy the code to compute the plot data is getting. Would this feature be a useful one to start a move to an AJAX model?</div>
<div><br></div><div> - Daniel</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 8, 2013 at 7:33 PM, Chris Matthews <span dir="ltr"><<a href="mailto:chris.matthews@apple.com" target="_blank">chris.matthews@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">This patch displays the date and time which a sample was taken inside the point mouseover in the LNT graph view.<div>
<br></div><div><div>Index: lnt/server/ui/templates/v4_graph.html</div><div>===================================================================</div><div>--- lnt/server/ui/templates/v4_graph.html<span style="white-space:pre-wrap"> </span>(revision 188037)</div>
<div>+++ lnt/server/ui/templates/v4_graph.html<span style="white-space:pre-wrap"> </span>(working copy)</div><div>@@ -117,10 +117,14 @@</div><div> var tip_body = '<div id="tooltip">';</div><div>
</div><div> if ("label" in meta_data) {</div><div>- tip_body += "<b>Revision:</b>" + meta_data.label + "<br>";</div><div>+ tip_body += "<b>Revision:</b> " + meta_data.label + "<br>";</div>
<div> }</div><div>- tip_body += "<b>Value:</b>" + data[1].toFixed(4) + "</div>";</div><div>+ tip_body += "<b>Value:</b> " + data[1].toFixed(4) + "<br>";</div>
<div> </div><div>+ if ("date" in meta_data) {</div><div>+ tip_body += "<b>Date:</b> " + meta_data.date;</div><div>+ }</div><div>+ tip_body += "</div>";</div>
<div> var tooltip_div = $(tip_body).css( {</div><div> position: 'absolute',</div><div> display: 'none',</div><div>Index: lnt/server/ui/views.py</div><div>===================================================================</div>
<div>--- lnt/server/ui/views.py<span style="white-space:pre-wrap"> </span>(revision 188037)</div><div>+++ lnt/server/ui/views.py<span style="white-space:pre-wrap"> </span>(working copy)</div><div>@@ -513,7 +513,7 @@</div>
<div> # we want to load. Actually, we should just make this a single query.</div><div> #</div><div> # FIXME: Don't hard code field name.</div><div>- q = ts.query(field.column, ts.Order.llvm_project_revision).\</div>
<div>+ q = ts.query(field.column, ts.Order.llvm_project_revision, ts.Run.start_time).\</div><div> join(ts.Run).join(ts.Order).\</div><div> filter(ts.Run.machine_id == <a href="http://machine.id" target="_blank">machine.id</a>).\</div>
<div> filter(ts.Sample.test == test).\</div><div>@@ -526,7 +526,7 @@</div><div> (field.status_field.column == None))</div><div> </div><div> # Aggregate by revision.</div><div>
- data = util.multidict((rev, val) for val,rev in q).items()</div><div>+ data = util.multidict((rev, (val, date)) for val,rev,date in q).items()</div><div> data.sort(key=lambda sample: convert_revision(sample[0]))</div>
<div> </div><div> # Compute the graph points.</div><div>@@ -536,25 +536,34 @@</div><div> moving_median_data = []</div><div> moving_average_data = []</div><div> if normalize_by_median:</div>
<div>- normalize_by = 1.0/stats.median([min(values)</div><div>+ normalize_by = 1.0/stats.median([min([d[0] for d in values])</div><div> for _,values in data])</div>
<div> else:</div><div> normalize_by = 1.0</div><div>- for pos, (point_label, orig_values) in enumerate(data):</div><div>+ for pos, (point_label, datapoints) in enumerate(data):</div><div>
+ # Get the samples.</div><div>+ data = [data_date[0] for data_date in datapoints]</div><div>+ # And the date on which they were taken.</div><div>+ dates = [data_date[1] for data_date in datapoints]</div>
<div>+</div><div> metadata = {"label":point_label}</div><div> # on simple revisions use rev number for x else start from</div><div> # 0</div><div> rev_x = convert_revision(point_label)</div>
<div> x = rev_x if len(rev_x)==1 else pos</div><div>- values = [v*normalize_by for v in orig_values]</div><div>- min_value = min(values)</div><div>+</div><div>+ values = [v*normalize_by for v in data]</div>
<div>+ min_index,min_value = min(enumerate(values))</div><div>+ metadata["date"] = str(dates[min_index])</div><div> pts.append((x, min_value, metadata))</div><div> </div><div> # Add the individual points, if requested.</div>
<div> # For each point add a text label for the mouse over.</div><div> if show_all_points:</div><div>- for v in values:</div><div>- points_data.append((x, v, metadata))</div>
<div>+ for i,v in enumerate(values):</div><div>+ point_metadata = dict(metadata)</div><div>+ point_metadata["date"] = str(dates[i]) </div><div>+ points_data.append((x, v, point_metadata))</div>
<div> elif show_points:</div><div> points_data.append((x, min_value, metadata))</div><div> </div></div><div></div></div><br><div style="word-wrap:break-word"><div></div><div><br></div><div>
<br></div><div><div><div style="text-indent:0px;letter-spacing:normal;text-align:start;text-transform:none;white-space:normal;word-wrap:break-word;word-spacing:0px"><div style="text-indent:0px;letter-spacing:normal;text-align:start;text-transform:none;white-space:normal;word-wrap:break-word;word-spacing:0px">
<div style="text-indent:0px;letter-spacing:normal;text-align:start;text-transform:none;white-space:normal;word-wrap:break-word;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;white-space:normal;font-family:Helvetica;word-spacing:0px">Chris Matthews</span><br style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;white-space:normal;font-family:Helvetica;font-weight:normal;word-spacing:0px">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;white-space:normal;font-family:Helvetica;word-spacing:0px"><a href="mailto:chris.matthews@apple.com" target="_blank">chris.matthews@apple.com</a></span><br style="line-height:normal;text-indent:0px;letter-spacing:normal;text-align:start;font-variant:normal;text-transform:none;font-style:normal;white-space:normal;font-family:Helvetica;font-weight:normal;word-spacing:0px">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;white-space:normal;font-family:Helvetica;word-spacing:0px"><a href="tel:%28408%29%20783-6335" value="+14087836335" target="_blank">(408) 783-6335</a></span><br>
</div></div></div>
</div>
<br></div></div><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>