Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
do not report to netdata not-collected values as zero
- Loading branch information
Showing
1 changed file
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7c081b0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exception will never raise
if it should be None if there is no 'key' in the slave_raw_data dict you need to remove get and setdefault methods
7c081b0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. you are the python expert. I just tried to follow the same principle I found on the
Thread_cache_misses
.Actually, if
slave_raw_data
is already adict
, why do we need all these? We could just pass it back and use the official mysql names for the members.Am I missing something?
7c081b0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am not an expert too.
slave_raw_data['Slave_SQL_Running'] / slave_raw_data['Slave_IO_Running'] == 'Yes' or 'No'
slave_raw_data['Seconds_Behind_Master'] type is Long thats why there is int() (maybe we dont need it here)
So we need to build own dict based on the slave_raw_data values.
I am not sure about try/except stuff.
I mean whether there can be a situation when a bool(slave_raw_data) is True and needed keys(Seconds_Behind_Master etc ) are missing - but it never hurts .
7c081b0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, you are right.
this is what I think too.
Thanks!