Reduce execution time and mysql/ws2300 queries
Introduction
Optimize the delay and execution time of mysqlhistlog23000, and also indicate what is done (be verbose)
Description of Patch
This optimized version, check the date time of the last mySql entries in the database, then query ws2300 only for new data to store in mysql. This is done instead spending time for reading 175 records from WS2300 and trying to insert 175 records on mysql database. Sometime just to update one program could work for 3/4 minutes. If program is spawned every 5 minutes, it take about 15 seconds to execute.
Also I set up mysqlhistlog2300 program to me more verbose, because launching program and wait before screen without knowing what program is doing is very frustrating (from my point of view). As it does not return any data I think it's not an issue to ve verbose.
Installation of Patch
apply the mysqlhistlog2300.diff
mysqlhistlog2300.diff
I'd like to release this patch on trunk if everybody agree
Change History of Patch
First Version
I am the author of mysqlhistlog2300. I have explicitly left out the lookup for the last valid record in the database.
If you like to call the WS23xx every 5 minutes than better use mysql2300 instead. mysqlhistlog is better used when you log in the WS23xx every 5 min but your PC is not up all the time or does collect the data every 2 hours only. Than you retrieve the values in one run.
At a glance: Use fetch2300/mysql2300 if your server is up all time. Use histlog2300/mysqlhistlog2300 if you log frequently and collect seldom (e.g. holiday).
N.B: Do not use mysql2300 and mysqlhistlog2300 in a mixed mode as the rain_values might vary! -> See bug reports.
--
OschenLars - 22 Nov 2011
--
OschenLars - 22 Nov 2011
P.S: Also histlog2300 does not support the tendency and forecast data collection. fetch2300 does.
--
OschenLars - 22 Nov 2011