Skip to content

Commit

Permalink
Removing network implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
elvio.aruta98 committed Jan 3, 2024
1 parent a541840 commit 8ba9f24
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions inorbit_edge/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,24 +840,15 @@ def publish_system_stats(
cpu_load_percentage=None,
ram_usage_percentage=None,
hdd_usage_percentage=None,
total_tx=None,
total_rx=None,
ts=None,
elapsed_seconds=None,
):
"""Publishes system information (CPU load, RAM usage, HDD usage, network stats)
Args:
cpu_load_percentage (float, value between 0.0 and 1.0): CPU usage.
ram_usage_percentage (float, value between 0.0 and 1.0): RAM usage.
hdd_usage_percentage (float, value between 0.0 and 1.0): HDD usage.
total_tx (int): Total bytes transmitted
total_rx (int): Total bytes received
ts (int): Timestamp. Defaults to int(time() * 1000).
It is needed to calculate the network rate in InOrbit
elapsed_seconds (float): Duration of the reported period.
It is needed to calculate the network rate in InOrbit
If not provided, network rate will not be calculated.
"""

if not self._should_publish_message(method="publish_system_stats"):
Expand All @@ -867,10 +858,7 @@ def publish_system_stats(
msg.cpu_load_percentage = cpu_load_percentage
msg.ram_usage_percentage = ram_usage_percentage
msg.hdd_usage_percentage = hdd_usage_percentage
msg.total_tx = total_tx
msg.total_rx = total_rx
msg.timestamp = ts if ts else int(time.time() * 1000)
msg.elapsed_seconds = elapsed_seconds if elapsed_seconds else 0

self.publish_protobuf(MQTT_SUBTOPIC_SYSTEM_STATS, msg)

Expand Down

0 comments on commit 8ba9f24

Please sign in to comment.