|
@@ -27,7 +27,13 @@ MySQLBackendCountersEngine.prototype.buildQuerries = function(userCounters, time
|
|
|
* - userCounterName: Counter name
|
|
|
* - counterValue: Counter value
|
|
|
*/
|
|
|
- querries.push("insert into `counters_statistics` select "+time_stamp+", '"+userCounterName+"' , if(max(value),max(value),0) + "+counterValue+" from `counters_statistics` where if(name = '"+userCounterName+"', 1,0) = 1 ;");
|
|
|
+
|
|
|
+ // old strategy
|
|
|
+ // querries.push("insert into `counters_statistics` select "+time_stamp+", '"+userCounterName+"' , if(max(value),max(value),0) + "+counterValue+" from `counters_statistics` where if(name = '"+userCounterName+"', 1,0) = 1 ;");
|
|
|
+
|
|
|
+ // new strategy
|
|
|
+ querries.push("INSERT INTO `counters_statistics` (`timestamp`, `name`, `value`) VALUES ("+time_stamp+", '"+userCounterName+"', "+counterValue+")");
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -43,4 +49,4 @@ MySQLBackendCountersEngine.prototype.buildQuerries = function(userCounters, time
|
|
|
exports.init = function() {
|
|
|
var instance = new MySQLBackendCountersEngine();
|
|
|
return instance;
|
|
|
-};
|
|
|
+};
|