Skip to content

Commit 4ad0d38

Browse files
committed
do not pload external stats without any values
1 parent 7f66c96 commit 4ad0d38

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

es_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,9 @@ def es_send_external_stats(
451451
es_index_name="externals_stats_summary",
452452
es_doc_name="externals-stats-summary",
453453
):
454+
sdata = get_summary_stats_from_json_file(stats_dict_file_path, cpu_normalize)
455+
if not sdata:
456+
return
454457
file_stamp = int(tstat(stats_dict_file_path).st_mtime) # get the file stamp from the file
455458
week = epoch2week(file_stamp)
456459
with open(opts_dict_file_path, "r") as opts_dict_f:
@@ -459,7 +462,6 @@ def es_send_external_stats(
459462
index_sha = sha1(
460463
("".join([str(x) for x in opts_dict.values()]) + stats_dict_file_path).encode()
461464
).hexdigest()
462-
sdata = get_summary_stats_from_json_file(stats_dict_file_path, cpu_normalize)
463465
sdata.update(opts_dict)
464466
sdata["@timestamp"] = file_stamp * 1000
465467
try:

0 commit comments

Comments
 (0)