123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /**
- *
- *
- */
- function MySQLBackendGaugesEngine() {
- var self = this;
- }
- /**
- *
- *
- */
- MySQLBackendGaugesEngine.prototype.buildQuerries = function(gauges, time_stamp) {
- var querries = [];
- // Iterate on each gauge
- for(var gaugeName in gauges) {
- var gaugeValue = gauges[gaugeName];
- if(gaugeValue === 0) {
- continue;
- } else {
- /**********************************************************************
- * Edit following line to custumize where statsd datas are inserted
- *
- * Parameters :
- * - userCounterName: Counter name
- * - counterValue: Counter value
- */
- querries.push("insert into `gauges_statistics` values ("+time_stamp+", '"+gaugeName+"', "+gaugeValue+");");
- }
- }
- return querries;
- }
- /**
- *
- *
- */
- exports.init = function() {
- var instance = new MySQLBackendGaugesEngine();
- return instance;
- };
|