Commit f7e09f5a authored by Rafael Monnerat's avatar Rafael Monnerat

Draft of slapos monitoring

parent 553c22c9
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dygraph</title>
<script src="../lib/rsvp.min.js" type="text/javascript"></script>
<script src="../lib/renderjs.min.js" type="text/javascript"></script>
<script src="slapos_monitoring.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
/*jslint nomen: true*/
/*global rJS */
(function (window, document, rJS) {
"use strict";
var gk = rJS(window);
var gadget_path_list = {
dygraph: "../viewer_dygraph/index.html"
};
return gk.declareMethod('addChart', function(options, chart_id) {
var g = this;
console.log(options.source_url);
var data_source = options.source_url + "/" + chart_id;
return this.declareGadget(gadget_path_list.dygraph)
.push(function(gadget) {
g.__element.appendChild(gadget.__element);
return gadget.render(data_source);
});
})
.declareMethod('render', function(options) {
if (options.source_url === undefined) {
throw "undefined source_url";
}
var div = document.createElement("div");
var g = this;
return g.addChart(options, "system_cpu_percent.csv")
.push(function () {
return g.addChart(options, "system_disk_memory_free__dev_sda1.csv");
})
.push(function () {
return g.addChart(options, "system_disk_memory_free__dev_sda1.csv");
})
.push(function () {
return g.addChart(options, "system_disk_memory_free__dev_sdb1.csv");
})
.push(function () {
return g.addChart(options, "system_disk_memory_used__dev_sda1.csv");
})
.push(function () {
return g.addChart(options, "system_disk_memory_used__dev_sdb1.csv");
})
.push(function () {
return g.addChart(options, "system_loadavg.csv");
})
.push(function () {
return g.addChart(options, "system_memory_free.csv");
})
.push(function () {
return g.addChart(options, "system_memory_used.csv");
})
.push(function () {
return g.addChart(options, "system_net_in_bytes.csv");
})
.push(function () {
return g.addChart(options, "system_net_in_dropped.csv");
})
.push(function () {
return g.addChart(options, "system_net_in_errors.csv");
})
.push(function () {
return g.addChart(options, "system_net_out_bytes.csv");
})
.push(function () {
return g.addChart(options, "system_net_out_dropped.csv");
})
.push(function () {
return g.addChart(options, "system_net_out_errors.csv");
})
.push(function () {
return g.addChart(options, "system_loadavg.csv");
});
});
}(window, document, rJS));
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/*global console, Dygraph, rJS */
/*jslint nomen: true */
(function (window, rJS, Dygraph) {
"use strict";
rJS(window)
.declareMethod('render', function (data) {
console.log(this.__element);
return new Dygraph(
this.__element,
data,
{
roolPeriod: 7,
errorBars: true
}
);
});
}(window, rJS, Dygraph));
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dygraph</title>
<script src="../lib/rsvp.min.js" type="text/javascript"></script>
<script src="../lib/renderjs.min.js" type="text/javascript"></script>
<script src="dygraph-combined.js" type="text/javascript" charset="utf-8"></script>
<script src="dygraph_gadget.js" type="text/javascript"></script>
</head>
<body>
<div></div>
</body>
</html>
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