Skip to content

Commit

Permalink
Try with round
Browse files Browse the repository at this point in the history
  • Loading branch information
niemijoe committed Aug 18, 2022
1 parent e969fe3 commit b0f7aa2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mqtt_data_collector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import paho.mqtt.client as mqtt
import time
import math
import json
from datetime import datetime
from threading import Thread
Expand Down Expand Up @@ -159,7 +158,7 @@ def get_series_array(topic_data_collection):
topic_msg_count = topic_data_collection[key]

# We want message count to be message per second
topic_msg_count = math.ceil(topic_msg_count/MONITOR_PERIOD_IN_SECONDS)
topic_msg_count = round(topic_msg_count/MONITOR_PERIOD_IN_SECONDS, 2)

# Azure doesn't seem to like # in a dimValue, replace it with *
parsed_key = key.replace("#", "*")
Expand Down

0 comments on commit b0f7aa2

Please sign in to comment.