Slide 12
Slide 12 text
Plot data with Epoch
function timestamp() { return (new Date).getTime() / 1000; }
var chart = $("#chart").epoch({
type: "time.line",
axes: ["left", "bottom"],
data: [
{label: "Writes", values: [{time: timestamp(), y: 0}]},
{label: "Reads", values: [{time: timestamp(), y: 0}]}
]
});
var socket = io.connect();
socket.on("stats", function(data) {
cluster.stats = data.query_engine;
chart.push([
{time: timestamp(), y: cluster.stats.written_docs_per_sec},
{time: timestamp(), y: cluster.stats.read_docs_per_sec}
]);
});