Skip to content

Commit

Permalink
[change] Transfer chart configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryamanz29 committed Jun 24, 2022
1 parent fcb0224 commit 07aa783
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion openwisp_monitoring/check/classes/iperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def check(self, store=True):
device_connection = self._get_device_connection(device)
if not device_connection:
logger.warning(
f'"DeviceConnection is not properly set for "{device}", iperf check skipped!'
f'DeviceConnection is not properly set for "{device}", iperf check skipped!'
)
return
device_connection.connect()
Expand Down
5 changes: 3 additions & 2 deletions openwisp_monitoring/db/backends/influxdb/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@
},
'transfer': {
'influxdb': (
"SELECT MEAN(sent_bytes) AS sent, "
"MEAN(received_bytes) AS received FROM {key} WHERE "
"SELECT SUM(received_bytes) AS received, "
"SUM(sent_bytes) AS sent,"
"SUM(sent_bytes) + SUM(received_bytes) AS total FROM {key} WHERE "
"time >= '{time}' AND content_type = '{content_type}' AND "
"object_id = '{object_id}' GROUP BY time(1d)"
)
Expand Down
13 changes: 10 additions & 3 deletions openwisp_monitoring/monitoring/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,17 +574,24 @@ def _get_access_tech():
'colors': [DEFAULT_COLORS[5], DEFAULT_COLORS[9]],
},
'transfer': {
'type': 'stackedbar',
'type': 'stackedbar+lines',
'title': _('Transfer'),
'trace_type': {
'received': 'stackedbar',
'sent': 'stackedbar',
'total': 'lines',
},
'trace_order': ['total', 'received', 'sent'],
'description': _('Total transfer during Iperf3 test in TCP mode.'),
'summary_labels': [
_('Sent bytes'),
_('Received bytes'),
_('Sent bytes'),
_('Total upload traffic'),
],
'unit': _(' GB'),
'order': 290,
'query': chart_query['transfer'],
'colors': [DEFAULT_COLORS[2], DEFAULT_COLORS[4]],
'colors': [DEFAULT_COLORS[7], DEFAULT_COLORS[2], DEFAULT_COLORS[4]],
},
'retransmits': {
'type': 'bar',
Expand Down

0 comments on commit 07aa783

Please sign in to comment.