var Dashboard = React.createClass({
getInitialState: function() {
return {};
},
componentDidMount: function() {
this.reload();
},
reload: function() {
getURL("http://127.0.0.1:6464/stats.json", {}, function(resp) {
var newState = {};
var decode = function(point) {
return {
timestamp: point[0],
processed: point[1],
errors: point[2],
min: point[3],
p25: point[4],
mean: point[5],
median: point[6],
p75: point[7],
max: point[8],
}
};
for (name in resp) {
newState[name] = resp[name].map(decode);
}
this.setState(newState);
setTimeout(this.reload, 3000);
}.bind(this));
},
renderDaemons: function() {
var daemons = [];
for (name in this.state) {
daemons.push(