<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">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 class="Apple-tab-span" style="white-space:pre"> </span>(revision 188037)</div><div>+++ lnt/server/ui/templates/v4_graph.html<span class="Apple-tab-span" style="white-space:pre"> </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 class="Apple-tab-span" style="white-space:pre"> </span>(revision 188037)</div><div>+++ lnt/server/ui/views.py<span class="Apple-tab-span" style="white-space:pre"> </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 == machine.id).\</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></body></html>