Skip to content

Commit

Permalink
Separate fields with a , (#69)
Browse files Browse the repository at this point in the history
* Separate fiels with a ,

* Fix metrics test

* Fix test

Co-authored-by: Kartik Ohri <kartikohri13@gmail.com>
  • Loading branch information
mayhem and amCap1712 authored May 14, 2021
1 parent 62e4a9b commit 3906b7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion brainzutils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def set(metric_name: str, tags: Dict[str, str] = None, timestamp: int = None, **
else:
fields_list.append("%s=%s" % (k, str(v)))

fields = " ".join(fields_list)
fields = ",".join(fields_list)

if timestamp is None:
timestamp = time_ns()
Expand Down
2 changes: 1 addition & 1 deletion brainzutils/test/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ def test_set(self, rpush):
os.environ["PRIVATE_IP"] = "127.0.0.1"
metrics.set("my_metric", timestamp=1619629462352960742, test_i=2, test_fl=.3, test_t=True, test_f=False, test_s="gobble")
rpush.assert_called_with(metrics.REDIS_METRICS_KEY,
'my_metric,dc=hetzner,server=127.0.0.1,project=listenbrainz.org test_i=2i test_fl=0.3 test_t=t test_f=f test_s="gobble" 1619629462352960742')
'my_metric,dc=hetzner,server=127.0.0.1,project=listenbrainz.org test_i=2i,test_fl=0.3,test_t=t,test_f=f,test_s="gobble" 1619629462352960742')

0 comments on commit 3906b7d

Please sign in to comment.