Closed romain-fontugne closed 11 years ago
It may be that they're not being interpreted correctly. This took a long time to fix on the php version of getalarms. It's worth going back to that build and looking at that.
OK, thanks for the pointers. I will look at that today.
Well... the source of the problem was from a MySQL attribute (on_update CURRENT_TIMESTAMP) that changed start on any update.... I've removed this attribute from the joyment server and I advice you do same on your local deployments
But I now get another problem, the connection between TsdbShim and getalarms.js seems to stop if there is too much data. Here is the error I get:
undefined:1
99761581421],[1306315006,0.8999999761581421],[1306315106,0.8999999761581421],[
^
SyntaxError: Unexpected end of input
at Object.parse (native)
at IncomingMessage.<anonymous> (/home/pangia/repo/Pangia/routes/getalarms.js:145:14)
at IncomingMessage.EventEmitter.emit (events.js:95:17)
at IncomingMessage.<anonymous> (_stream_readable.js:699:14)
at IncomingMessage.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:382:10)
at emitReadable (_stream_readable.js:377:5)
at readableAddChunk (_stream_readable.js:142:7)
at IncomingMessage.Readable.push (_stream_readable.js:112:10)
at HTTPParser.parserOnBody [as onBody] (http.js:140:22)
make: *** [server] Error 8
It is fixed! The HTTP response is sent in several chunks if there is too may data. This is now handled in getalarm.js
@romain-fontugne Oh, interesting, but how was that related to the timestamps?
To test the graph I had to manually modify the alarms through phpmyadmin and every time I modified an alarm its "start" value was set to "NOW()" (because of an option that was selected in MySQL)..... I didn't see that at first because phpmyadmin do not refresh the column automatically updated when the modification are done inline... (so it actually an issue with phpmyadmin! :-( )
Anyway, I advice you to remove the "on_update CURRENT_TIMESTAMP" attribute for the start column as it raises undesired values. I also cleaned a bit the code in getAlarms that manipulates the alarms timestamps.
I still have difficulties in plotting the graphs. The plots are empty. It seems that getalarms.js fetchs data in TSDB with wrong timestamp. Here is what's I have done: Using chart.php I've tried to plot the following alarm that happened in 2011.
but this is what TsdbShim output:
The timestamps are completely random...