Skip to content

Commit

Permalink
Message count as messages per second
Browse files Browse the repository at this point in the history
  • Loading branch information
niemijoe committed Aug 18, 2022
1 parent 7b1b680 commit e969fe3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mqtt_data_collector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import paho.mqtt.client as mqtt
import time
import math
import json
from datetime import datetime
from threading import Thread
Expand Down Expand Up @@ -157,6 +158,9 @@ def get_series_array(topic_data_collection):
for key in 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)

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

0 comments on commit e969fe3

Please sign in to comment.