08 24 feat sparkles add hychain metrics#119
Conversation
…thub.com/deeep-network/ansible_collections into 08-24-feat_sparkles_adds_hychain_service
| class MetricsCollector(Collector): | ||
| """Collector for Gala Node information""" | ||
| def total_uptime_count(sefl, autonomi_service_date): | ||
| def total_uptime_count(sefl, hychain_service_date): |
There was a problem hiding this comment.
The parameter sefl in the method definition is a typo and should be corrected to self. This correction is necessary to ensure proper access to instance attributes and methods within the class. Consider updating the method signature to:
def total_uptime_count(self, hychain_service_date):This change will align with Python conventions and prevent potential errors in method execution.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
| p = pid_decription.split()[0] | ||
| if p == pid_id: | ||
| print(pid_decription) | ||
| mounth = pid_decription.split()[3] |
There was a problem hiding this comment.
The variable mounth is misspelled and should be corrected to month. This typo could potentially lead to confusion and errors in date handling. Consider updating the variable name to ensure clarity and consistency throughout the code.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
| minutes = int(state_uptime_dic[1]) | ||
| seconds = int(state_uptime_dic[2]) | ||
| state_uptime=seconds+minutes*60+hours*3600 | ||
| date_str = mounth + "-" + day + "-" + years + " " + time_str |
There was a problem hiding this comment.
The variable mounth is misspelled. It should be corrected to month to accurately represent the month value and prevent potential errors in date string construction.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
| for pid_decription in services_pids: | ||
| pid_decription = pid_decription.decode("utf-8") | ||
| p = pid_decription.split()[0] |
There was a problem hiding this comment.
The variable pid_decription appears to be a typo and should be corrected to pid_description. This misspelling is consistent throughout the loop. It's advisable to correct all instances of this variable name for improved code readability and to prevent potential confusion or errors in future maintenance.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
|
I'm curious if this collector is repeating the metrics already collected by the Netdata agent running on the VM. Since it appears it's only collecting the time and status of the process related to the node? If there isn't a CLI or metric provided by the software, we might need to incorporate a API call to the blockchain and see if rewards are being collected as a proxy. |
There are only CLI commands for HYCHAIN Guardian Node Software. |
0f56e67 to
8f5689c
Compare
No description provided.