var history = [], max = 50, table_rows = 10, measures, colors, info, stats_to_update = ['uptime_in_seconds', 'uptime_in_days'] var chart_options = { chart1: { seriesDefaults: { showMarker: false, shadow: false }, axesDefaults: { labelRenderer: $.jqplot.CanvasAxisLabelRenderer, tickRenderer: $.jqplot.CanvasAxisTickRenderer }, axes: { xaxis: { pad: 1, min: - max, tickOptions: { show: true } }, yaxis: { label:'Commands/sec', min: 0, pad: 1.2 } }, grid: { borderWidth: 0.0, borderColor: '#ddd', background: '#ffffff', shadowAlpha: 0.03 } }, chart2: { seriesDefaults: { showMarker: false, shadow: false, fill: true }, series: [ { label: "user" }, { label: "sys" } ], stackSeries: true, axesDefaults: { labelRenderer: $.jqplot.CanvasAxisLabelRenderer, tickRenderer: $.jqplot.CanvasAxisTickRenderer, shadow: false }, axes: { xaxis: { pad: 1, min: - max, tickOptions: { show: true } }, yaxis: { label:'CPU usage', min: 0, pad: 1.0 } }, legend: { show: true, location: 'se' }, grid: { borderWidth: 0.0, borderColor: '#ddd', background: '#ffffff', shadowAlpha: 0.03 } }, chart3: { seriesDefaults: { showMarker: false, shadow: false, }, series: [ { label: "used" }, { label: "rss" } ], axesDefaults: { labelRenderer: $.jqplot.CanvasAxisLabelRenderer, tickRenderer: $.jqplot.CanvasAxisTickRenderer, shadow: false }, axes: { xaxis: { pad: 1, min: - max, tickOptions: { show: true } }, yaxis: { label:'Memory usage', min: 0, pad: 1.2, tickOptions: { formatString: "%dMB" } } }, legend: { show: true, location: 'se' }, grid: { borderWidth: 0.0, borderColor: '#ddd', background: '#ffffff', shadowAlpha: 0.03 } }, } var initialize = function(m, c) { measures = m colors = c info = $("#info") $.jqplot('chart1', [[[-1, 0]]], chart_options.chart1) $.jqplot('chart2', [[[-1, 0]]], chart_options.chart2) $.jqplot('chart3', [[[0, 'MEM'], [0, 'RSS']]], chart_options.chart3) } var update = function(json) { var js = json.static, jd = json.dynamic history.push(json) if (history.length > max) history.shift() // Instance information (mostly static) // for (stat in js) { for (var i = 0; i < stats_to_update.length; ++i) { var stat = stats_to_update[i] $("#" + stat).replaceWith( "