SPARK-1800: Add Hedge Traces

This commit is contained in:
Michael Harding committed 2018-10-26 10:15:43 -04:00
1 parent cbb638ff7a
commit 2c384af157
2 files changed
+164 -71

No files matched your search

+13 -3
View File
@@ -1,14 +1,14 @@
<html>
<head>
<title>BTS Spark Socket To Socket Requote Times</title>
<title>BTS Spark Socket To Socket Requote and Hedge Times</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/perf_trace/compiled.css">
<script src="https://cdn.polyfill.io/v2/polyfill.js?features=es6"></script>
<style type="text/css">
.summary-block {
margin: 2em 1em;
padding: 1em 1em;
}
.summary-block > ul {
margin: 0em 1em;
@@ -23,6 +23,16 @@
.clear {
clear:both;
}
.session-table tr {
padding-top: 1em;
}
.session-table th {
background-color: #4169AA;
color:#fff;
text-align: center;
padding: 1em;
border-left: 1px solid #f6f6f6;
}
</style>
</head>
@@ -47,7 +57,7 @@
</ul>
</div-->
<div style="margin:2em 0 0 2em;"><!--div class="is-tab-content" is-tab-content is shorter than the screen to accommodate tabs at the top -->
<h1 class="is-size-2">Socket To Socket Requote Times</h1>
<h1 class="is-size-2">Socket To Socket Latencies</h1>
<div id="output"></div>
</div>
</div>
+151 -68
View File
@@ -2,7 +2,9 @@ $( document ).ready(function (){
let urlParams = new URLSearchParams(window.location.search);
num_rows = urlParams.get('r');
let show_rows = urlParams.get('showrows');
let rows_of = urlParams.get('rowsof');
//let trace_data_url = "./perf_trace_data";
let trace_data_url = "/perf_trace_data";
if(num_rows != null) {
trace_data_url += "/" + num_rows;
@@ -15,14 +17,29 @@ $( document ).ready(function (){
error: ajax_err,
crossDomain: true
}).done(function(result) {
if(show_rows != null) {
list_rows(show_rows, result);
if(rows_of === "quot") {
list_rows(show_rows, rows_of, result.requotes);
}
else {
list_rows(show_rows, rows_of, result.hedges);
}
}
else {
if(result.length > 0){
let summary_info = "<h1 class='is-size-3'><b>Host:</b> " + result[0].host + "</h1>";
if(result.requotes.length > 0){
let summary_info = "<h1 class='is-size-3'><b>Host:</b> " + result.requotes[0].host + "</h1><br>";
$("#output").html(summary_info);
$(result).each(display_session);
$(result.requotes).each(function (index, quot_val){
$(result.hedges).each( function(index, hed_val){
if(quot_val.session_name === hed_val.session_name)
{
display_session(quot_val, hed_val);
return false;
}
});
});
}
}
@@ -30,29 +47,30 @@ $( document ).ready(function (){
});
function list_rows(show_rows, data) {
function list_rows(show_rows, rows_of, data) {
$.each(data, function(index, value){
if(value.session_name === show_rows){
let summary_info = "<table class='table bts-data-table'>";
summary_info += "<thead><tr><th>Trace Time</th>" +
"<th>Order Key</th>" +
"<th>MD</th>" +
"<th>Spreader</th>" +
"<th>Fix</th>" +
"<th>Total</th></tr></thead><tbody>";
summary_info += "<thead><tr><th>Trace Time</th>"
$.each(value.rows[0], function(key, unval){
if(key !== "trace_time" && key !== "total")
{
summary_info +="<th>" + format_title(key) + "</th>";
}
});
summary_info += "<th>Total</th></tr></thead><tbody>";
$.each(value.rows, function(key, val) {
summary_info += "<tr>";
console.log(val);
summary_info += "<td>" + val.trace_time + "</td>" +
"<td>" + val.order_key + "</td>" +
"<td>" + val.md + "</td>" +
"<td>" + val.spreader + "</td>" +
"<td>" + val.fix + "</td>" +
"<td>" + val.total + "</td>";
summary_info += "<td>" + val.trace_time + "</td>";
$.each(value.rows[0], function(key, uval){
if(key !== "trace_time" && key !== "total")
{
summary_info += "<td>" + uval + "</td>";
}
});
summary_info += "<td>" + val.total + "</td>";
summary_info += "</tr>";
});
summary_info += "</tbody></table>";
@@ -77,7 +95,26 @@ function ajax_err (jqXHR, textStatus,errorThrown) {
function first_upper (str)
{
let ret_str = str[0].toUpperCase() + str.substring(1, str.length);
return ret_str
return ret_str;
}
function format_title (str)
{
let ret_str = "";
for(let i=0; i < str.length; i++) {
if(i === 0 || str[i-1] === "_") {
ret_str += str[i].toUpperCase();
}
else if(str[i] === "_") {
ret_str += " ";
}
else {
ret_str += str[i];
}
}
return ret_str;
}
function generate_histogram(id, data)
@@ -95,70 +132,116 @@ function generate_histogram(id, data)
Plotly.newPlot(id, plot_data);
}
function display_session (index, value) {
//console.log(value);
let session_info = "<ul class=''>";
session_info += "<li id='" + value.session_name + "' class='is-size-5'><b>Session:</b> " + value.session_name + "</li>";
session_info += "<li><b>Build Type:</b> " + value.build_type + "</li>";
session_info += "<li><b>Version:</b> " + value.version + "</li>";
function write_summary (histo_id, v)
{
session_info = "<ul>";
session_info += "<li><b>" + format_title(v.value) + "</b></li>";
session_info += "<li>Min: " + v.min + "</li>";
session_info += "<li>Median: " + v.median + "</li>";
session_info += "<li>Max: " + v.max + "</li>";
session_info += "<li>99%: " + v.ninenty_nine + "</li>";
session_info += "<li>Standard Deviation: " + v.stdev + "</li>";
session_info += "</ul>";
session_info += "<div id='" + histo_id + "' class='histogram-div'></div>"
return session_info;
}
function display_session (quot_val, hed_val) {
let session_info = "<table class='session-table'>";
session_info += "<tr><td colspan='2' id='" + quot_val.session_name + "' class='is-size-5'><b>Session:</b> " + quot_val.session_name + "<br>";
session_info += "<b>Build Type:</b> " + quot_val.build_type + "<br>";
session_info += "<b>Version:</b> " + quot_val.version + "<br><br></td></tr>";
//column headers
session_info += "<tr><th>Requotes</th><th>Hedges</th></tr>"
if(num_rows != null) {
session_info += "<li><a href='?showrows=" + value.session_name + "&r=" + num_rows + "'><b>Rows:</b> " + value.n_rows + "</a></li>";
}
else {
session_info += "<li><a href='?showrows=" + value.session_name + "'><b>Rows:</b> " + value.n_rows + "</a></li>";
}
session_info += "<tr><td ><a href='?showrows=" + quot_val.session_name + "&rowsof=quot" + "&r=" + num_rows + "'><b>Rows:</b> " + quot_val.n_rows + "</a></td>";
session_info += "<td><a href='?showrows=" + hed_val.session_name + "&rowsof=hed" + "&r=" + num_rows + "'><b>Rows:</b> " + head_val.n_rows + "</a></td></tr>";
}
else {
session_info += "<tr><td><a href='?showrows=" + quot_val.session_name + "&rowsof=quot" + "'><b>Rows:</b> " + quot_val.n_rows + "</a></td>";
session_info += "<td><a href='?showrows=" + hed_val.session_name + "&rowsof=hed" + "'><b>Rows:</b> " + hed_val.n_rows + "</a></td></tr>";
}
$(value.summaries).each(function(i,v){
$(quot_val.summaries).each(function(i,v){
if(v.value === "total") {
session_info += "<li class='summary-block'><ul>";
session_info += "<li><b>" + first_upper(v.value) + "</b></li>";
session_info += "<li>Min: " + v.min + "</li>";
session_info += "<li>Median: " + v.median + "</li>";
session_info += "<li>Max: " + v.max + "</li>";
session_info += "<li>99%: " + v.ninenty_nine + "</li>";
session_info += "<li>Standard Deviation: " + v.stdev + "</li>";
session_info += "</ul>";
session_info += "<div id='" + value.session_name + "-" + v.value + "' class='histogram-div'></div>"
session_info += "</li>";
return false
session_info += "<tr><td class='summary-block'>";
session_info += write_summary(quot_val.session_name + "-quot-" + v.value, v);
session_info += "</td>";
return false
}
});
$(value.summaries).each(function(i,v){
if(v.value !== "total") {
session_info += "<li class='summary-block'><ul>";
session_info += "<li><b>" + first_upper(v.value) + "</b></li>";
session_info += "<li>Min: " + v.min + "</li>";
session_info += "<li>Median: " + v.median + "</li>";
session_info += "<li>Max: " + v.max + "</li>";
session_info += "<li>99%: " + v.ninenty_nine + "</li>";
session_info += "<li>Standard Deviation: " + v.stdev + "</li>";
session_info += "</ul>";
session_info += "<div id='" + value.session_name + "-" + v.value + "' class='histogram-div'></div>"
session_info += "</li>";
}
});
$(hed_val.summaries).each(function(i,v){
if(v.value === "total") {
session_info += "<td class='summary-block'>";
session_info += write_summary(hed_val.session_name + "-hed-" + v.value, v);
session_info += "</td></tr>";
return false
}
});
session_info += "</ul><hr class='clear'>";
let loop_val = 0;
if(quot_val.summaries.length >= hed_val.summaries.length ) {
loop_val = quot_val.summaries.length;
}
else {
loop_val = hed_val.summaries.length;
}
for(let i = 0; i < loop_val; i++) {
if(quot_val.summaries[i].value !== "total") {
session_info += "<tr><td class='summary-block'>";
if (hed_val.summaries[i] !== undefined) {
session_info += write_summary(quot_val.session_name + "-quot-" + quot_val.summaries[i].value, quot_val.summaries[i]);
}
session_info += "</td><td class='summary-block'>";
if (hed_val.summaries[i] !== undefined) {
session_info += write_summary(hed_val.session_name + "-hed-" + hed_val.summaries[i].value, hed_val.summaries[i]);
}
session_info += "</td></tr>";
}
}
session_info += "</table><hr class='clear'>";
$("#output").append(session_info);
let all_data = {};
let quot_val_data = {};
$(value.rows).each(function(i, row) {
$(quot_val.rows).each(function(i, row) {
$.each(row, function(name, v) {
if(all_data[name] === undefined){
all_data[name] = [v];
if(quot_val_data[name] === undefined){
quot_val_data[name] = [v];
}
else {
all_data[name].push(v);
quot_val_data[name].push(v);
}
});
});
//console.log(all_data);
let hed_val_data = {};
$(value.summaries).each(function(i,v){
generate_histogram(value.session_name + "-" + v.value, all_data[v.value]);
$(hed_val.rows).each(function(i, row) {
$.each(row, function(name, v) {
if(hed_val_data[name] === undefined){
hed_val_data[name] = [v];
}
else {
hed_val_data[name].push(v);
}
});
});
$(quot_val.summaries).each(function(i,v){
generate_histogram(quot_val.session_name + "-quot-" + v.value, quot_val_data[v.value]);
});
$(hed_val.summaries).each(function(i,v){
generate_histogram(hed_val.session_name + "-hed-" + v.value, hed_val_data[v.value]);
});
}