How to do reduce log interval
Moderator: leecollings
-
- Posts: 11
- Joined: Sunday 24 January 2016 17:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
How to do reduce log interval
Hi,
I would like to reduce the log interval from 5 minutes to 1 minute.
Which file of the source code do I need to modify and re-build?
Thank you
I would like to reduce the log interval from 5 minutes to 1 minute.
Which file of the source code do I need to modify and re-build?
Thank you
- nayr
- Posts: 354
- Joined: Tuesday 11 November 2014 18:42
- Target OS: Linux
- Domoticz version: github
- Location: Denver, CO - USA
- Contact:
Re: How to do reduce log interval
what?
There is no log interval.. if you dont have activity there is nothing to log.. or are you wanting higher resolution on the graphs?
There is no log interval.. if you dont have activity there is nothing to log.. or are you wanting higher resolution on the graphs?
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
-
- Posts: 11
- Joined: Sunday 24 January 2016 17:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to do reduce log interval
Yes, I would like to have higher resolution on the graphs/data logged.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: How to do reduce log interval
I think it would be better to have a setting per switch.
I would definitely don't wanna have records of all temps and setpoints every minute. That would be over a million records a month.
I would definitely don't wanna have records of all temps and setpoints every minute. That would be over a million records a month.
-
- Posts: 11
- Joined: Sunday 24 January 2016 17:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to do reduce log interval
My intention is to modify the code so that the interval is 1 minute instead of 5 minutes, and only log/record the value if the deviation is more than 10%.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: How to do reduce log interval
I guess the graphs can't handle gaps in the timings. What else could be the reason for storing the same value every 5 minutes?
I only keep temperature data of the last 12 hours and that's 3400 records.
I like to keep the database as small as possible, seems to be much faster and stable that way. Every night I remove records of temperature, meter, percentage devices I don't care about.
I only keep temperature data of the last 12 hours and that's 3400 records.
I like to keep the database as small as possible, seems to be much faster and stable that way. Every night I remove records of temperature, meter, percentage devices I don't care about.
-
- Posts: 11
- Joined: Sunday 24 January 2016 17:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to do reduce log interval
Dear Egregius,
"The man who says it can't be done... shouldn't interrupt the man who is trying to do it"
I would like to reduce the log interval from 5 minutes to 1 minute.
I am happy to work with the source code, and I would appreciate if somebody can tell me which are the file/s that I will need to modify.
Thank you
"The man who says it can't be done... shouldn't interrupt the man who is trying to do it"
I would like to reduce the log interval from 5 minutes to 1 minute.
I am happy to work with the source code, and I would appreciate if somebody can tell me which are the file/s that I will need to modify.
Thank you
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: How to do reduce log interval
Sorry for giving my opinion in a discussion board.
-
- Posts: 11
- Joined: Sunday 24 January 2016 17:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to do reduce log interval
I couldn't find an appropriate subforum, so I wrote my question in here.
I am trying to make a Historian and I would appreciate any constructive ideas/opinions.
I am trying to make a Historian and I would appreciate any constructive ideas/opinions.
- nayr
- Posts: 354
- Joined: Tuesday 11 November 2014 18:42
- Target OS: Linux
- Domoticz version: github
- Location: Denver, CO - USA
- Contact:
Re: How to do reduce log interval
the only way to learn the code base is to start digging into it, it would take longer to try to explain it than it would be to just implement it.. Ive been hacking at it for a while and still dont have a solid grasp of where everything is done at.. its alot of lines to look through.
the code is all yours, let us know what you come up with.. sorry I cant help you, Ive been avoiding mucking with the datasets directly until I better understand the consequences of my actions.
the code is all yours, let us know what you come up with.. sorry I cant help you, Ive been avoiding mucking with the datasets directly until I better understand the consequences of my actions.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
-
- Posts: 11
- Joined: Sunday 24 January 2016 17:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to do reduce log interval
I think it I can change it in the SQLHelper.cpp file.
But as you said, there is a lot of code to dig.
It would be great if someone could point to the right place.
But as you said, there is a lot of code to dig.
It would be great if someone could point to the right place.
-
- Posts: 11
- Joined: Sunday 24 January 2016 17:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to do reduce log interval
Just in case someone is interested (which I think there will be more than one)
I have successfully changed the log interval from 5 minutes to 1 minute by changing the iShortLogInterval in the SQLServer.cpp
And then rebuilding/re-making the code
I have successfully changed the log interval from 5 minutes to 1 minute by changing the iShortLogInterval in the SQLServer.cpp
And then rebuilding/re-making the code
- gizmocuz
- Posts: 2352
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: How to do reduce log interval
you have to remove 2 lines in the SQLServer.cpp and then you can change it in the database (actually the html code is also there but hidden)
then underneed remove these two lines
i probably must have some good reason not to expose this yet ?
Code: Select all
if (!GetPreferencesVar("ShortLogInterval", nValue))
{
nValue = 5;
UpdatePreferencesVar("ShortLogInterval", nValue);
}
Code: Select all
if (nValue < 1)
nValue = 5;
Quality outlives Quantity!
-
- Posts: 11
- Joined: Sunday 24 January 2016 17:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to do reduce log interval
Hi gizmocuz
Thank you for the additional information.
Thank you for the additional information.
- bizziebis
- Posts: 182
- Joined: Saturday 19 October 2013 14:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8805
- Location: The Netherlands
- Contact:
Re: How to do reduce log interval
I think with the right explanation next to the option a person should have the possibility to change the value from settings. Or are there any caveats when changing to a smaller interval?
I can imagine a fast growing database and a less responsive interface due to large json requests.
I can imagine a fast growing database and a less responsive interface due to large json requests.
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: How to do reduce log interval
Everyone has a specific reason for settings like this. I would't lower it, instead rise to 10 or 15 :p
Speed is more important than a graph for me.
But, as said before: the best option would be to set it for every sensor seperately.
Speed is more important than a graph for me.
But, as said before: the best option would be to set it for every sensor seperately.
- gizmocuz
- Posts: 2352
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: How to do reduce log interval
there has been another approach offered on this forum, if value is different then the last value in the log, add the value
could be worth investigating by someone
could be worth investigating by someone
Quality outlives Quantity!
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: How to do reduce log interval
That would even be a better solution
If it doesn't break the graphs that is.
In my situation I have a record every 5 minute in each room for a thermometer, a setpoint and a radiator valve. Especially for the setpoints it's very repitive data in the tables.
If it doesn't break the graphs that is.
In my situation I have a record every 5 minute in each room for a thermometer, a setpoint and a radiator valve. Especially for the setpoints it's very repitive data in the tables.
Re: How to do reduce log interval
Which file do we need to edit to change logging to 1 minute, is it SQLHelper.cpp or SQLServer.cpp??gizmocuz wrote:you have to remove 2 lines in the SQLServer.cpp and then you can change it in the database (actually the html code is also there but hidden)
then underneed remove these two linesCode: Select all
if (!GetPreferencesVar("ShortLogInterval", nValue)) { nValue = 5; UpdatePreferencesVar("ShortLogInterval", nValue); }
i probably must have some good reason not to expose this yet ?Code: Select all
if (nValue < 1) nValue = 5;
I tried it in SQLHelper.cpp and rebuild it with
gcc -c SQLHelper.cpp
And then again the:
make -j 4
But when i reboot the pi and/or reboot domoticz, i still have 5 min intervals.
Am i doing something wrong???
- gizmocuz
- Posts: 2352
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: How to do reduce log interval
Did you also made a change in the database as mentioned ?
Quality outlives Quantity!
Who is online
Users browsing this forum: Google [Bot] and 1 guest