add comment
This commit is contained in:
parent
8232da63c4
commit
efc74fcb47
1 changed files with 4 additions and 2 deletions
|
@ -98,14 +98,16 @@ class GetYoutubeVideos:
|
|||
'w',
|
||||
encoding='UTF-8'
|
||||
) as metrics_file:
|
||||
metrics_file.write('''# HELP get_youtube_summary Get YouTube videos summary metrics.
|
||||
# TYPE get_youtube_summary counter\n''')
|
||||
for key in data:
|
||||
if self._is_numeric(data[key]):
|
||||
metrics_file.write(f"get_youtube_videos_{key} {data[key]}")
|
||||
metrics_file.write(f"get_youtube_videos_{key} {data[key]}\n")
|
||||
elif isinstance(data[key], bool):
|
||||
value = 0
|
||||
if data[key]:
|
||||
value = '1'
|
||||
metrics_file.write(f"get_youtube_videos_{key} {value}")
|
||||
metrics_file.write(f"get_youtube_videos_{key} {value}\n")
|
||||
os.chmod('/var/lib/prometheus/node-exporter/get_youtube_videos.prom', stat.S_IROTH)
|
||||
|
||||
def _change_proxy(self, video_id):
|
||||
|
|
Loading…
Reference in a new issue