Commit 1a919614 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

modules/http: cleanup

parent 0f453309
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700");/*! /*!
* bootswatch v3.3.6 * bootswatch v3.3.6
* Homepage: http://bootswatch.com * Homepage: http://bootswatch.com
* Copyright 2012-2016 Thomas Park * Copyright 2012-2016 Thomas Park
......
...@@ -28,6 +28,13 @@ $(function() { ...@@ -28,6 +28,13 @@ $(function() {
graph.setVisibility(metrics[id][0], toggle); graph.setVisibility(metrics[id][0], toggle);
} }
} }
function formatNumber(n) {
with (Math) {
var base = floor(log(abs(n))/log(1000));
var suffix = 'KMB'[base-1];
return suffix ? String(n/pow(1000,base)).substring(0,3)+suffix : ''+n;
}
}
/* Initialize snippets. */ /* Initialize snippets. */
$('section').each(function () { $('section').each(function () {
...@@ -84,7 +91,7 @@ $(function() { ...@@ -84,7 +91,7 @@ $(function() {
visibility: visibility, visibility: visibility,
axes: { y: { axes: { y: {
axisLabelFormatter: function(d) { axisLabelFormatter: function(d) {
return d + ' pps'; return formatNumber(d) + 'pps';
}, },
}}, }},
series: series, series: series,
......
...@@ -43,25 +43,33 @@ ...@@ -43,25 +43,33 @@
<div class="container"> <div class="container">
<div class="main"> <div class="main">
<h2 class="sub-header">Metrics</h2> <h2 class="sub-header">Metrics</h2>
<div id="stats" class="row placeholders"> <div class="col-md-12">
<div id="chart" style="width:100%"></div> <div class="row">
</div> <div id="stats" class="row placeholders">
<div class="row"> <div id="chart" style="width:100%"></div>
<div class="col-md-12">
<h3><small>More metrics</small></h3>
<div class="col-md-11">
<select id="chart-selector" multiple></select>
</div> </div>
<div class="col-md-1"> </div>
<div class="checkbox"> <div class="row">
<label><input id="chart-stacked" type="checkbox">Stacked</label> <div class="col-md-12">
<h3><small>More metrics</small></h3>
<div class="col-md-11">
<select id="chart-selector" multiple></select>
</div>
<div class="col-md-1">
<div class="checkbox">
<label><input id="chart-stacked" type="checkbox">Stacked</label>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<a name="worldmap"></a> <a name="worldmap"></a>
<h2 class="sub-header">Where do the queries go?</h2> <h2 class="sub-header">Where do the queries go?</h2>
<div id="map" style="position: relative;"></div> <div class="col-md-12">
{{ snippets }} <div id="map" style="position: relative;"></div>
</div>
<div class="col-md-12">
{{ snippets }}
</div>
</div> </div>
</div> </div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment