Skip to content

Commit

Permalink
make metric_data_file_prefix global in functions
Browse files Browse the repository at this point in the history
- otherwise finish_samples() returns empty string
  • Loading branch information
atheurer committed Aug 5, 2024
1 parent 471cf0b commit 414b09e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/toolbox/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def log_sample(this_file_id: str, desc: object, names: object, sample: object):
None
"""

global file_id, total_logged_samples, total_cons_samples, stored_sample
global file_id, total_logged_samples, total_cons_samples, stored_sample, metric_data_file_prefix
file_id = this_file_id
metric_data_file_prefix = "metric-data-" + file_id
metric_data_file = metric_data_file_prefix + ".csv.xz"
Expand Down Expand Up @@ -167,7 +167,7 @@ def finish_samples():
str: The prefix of the metric data file that was written.
"""

global file_id, stored_sample, interval, metric_idx, metric_types
global file_id, stored_sample, interval, metric_idx, metric_types, metric_data_file_prefix
if file_id is not None:
new_metric_types = []
num_deletes = 0
Expand Down

0 comments on commit 414b09e

Please sign in to comment.