Graphs: Fix strong_signals data collection

dump1090 produces stats.json, this is read to produce the database the
graphs are based on. strong_signals is a counter which logs every message
with an RSSI of bigger than -3dBFS.
Currently this message counter is unlike the other message counters read
from the last1min instead of the total bucket. This creates bad data as
the rrd data source type used assumes a constantly increasing counter,
which the last1min bucket is not. When the last1min strong_signals
bucket decreases the database logs unkown, when last1min strong_signals
increase it logs the increase and divides it by the elapsed time which
assuming a relatively constant number of strong_signals per minute can
greatly underestimate the actual value of strong_signals received.
Change the data collection to use the total strong_signals bucket like
the other message logs. The data collection will log the difference
between readings and create a correct rate.
pull/474/head
Matthias Wirth 2018-10-13 17:58:43 +02:00
rodzic 5ac8dc11c9
commit 1197a5493d
1 zmienionych plików z 9 dodań i 8 usunięć

Wyświetl plik

@ -91,14 +91,6 @@ def read_stats_1min(instance_name, host, url):
values = [stats['last1min']['local']['noise']],
interval = 60)
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
type_instance='strong_signals',
time=T(stats['last1min']['end']),
values = [stats['last1min']['local']['strong_signals']],
interval = 60)
def read_stats(instance_name, host, url):
try:
@ -124,6 +116,15 @@ def read_stats(instance_name, host, url):
time=T(stats['total']['end']),
values = [counts[i]])
if stats['total']['local'].has_key('strong_signals'):
V.dispatch(plugin_instance = instance_name,
host=host,
type='dump1090_messages',
type_instance='strong_signals',
time=T(stats['total']['end']),
values = [stats['total']['local']['strong_signals']],
interval = 60)
# Remote message counts
if stats['total'].has_key('remote'):
counts = stats['total']['remote']['accepted']