From 264491044f16ca75a4b9d163652f837a303cca91 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sat, 13 Oct 2018 21:09:01 +0200 Subject: [PATCH] Graphs: Increase rrd size for local messages The Message Rate Graph displays a min/max area and an 7-day average that is calculated from the previous 7 days. Increase weekly database size for local messages to 8 days so that those 2 graphs are calculated and displayed with 8 minute instead of 37 minute granularity. --- bash/portal/graphs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bash/portal/graphs.sh b/bash/portal/graphs.sh index 7350391..092d077 100755 --- a/bash/portal/graphs.sh +++ b/bash/portal/graphs.sh @@ -40,6 +40,7 @@ PORTAL_BUILD_DIRECTORY="${RECEIVER_BUILD_DIRECTORY}/portal" COLLECTD_CONFIG="/etc/collectd/collectd.conf" COLLECTD_CRON_FILE="/etc/cron.d/adsb-receiver-performance-graphs" DUMP1090_MAX_RANGE_RRD="/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_range-max_range.rrd" +DUMP1090_MESSAGES_LOCAL_RRD="/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_messages-local_accepted.rrd" ### INCLUDE EXTERNAL SCRIPTS @@ -394,6 +395,14 @@ if [ -f "/var/lib/collectd/rrd/localhost/dump1090-localhost/dump1090_range-max_r fi fi +# Increase size of weekly messages table to 8 days +if [ -f ${DUMP1090_MESSAGES_LOCAL_RRD} ]; then + if [[ `rrdinfo ${DUMP1090_MESSAGES_LOCAL_RRD} | grep -c "rra\[6\]\.rows = 1260"` -eq 1 ]] ; then + echo -e "\e[94m Increasing weekly table size to 8 days in messages-local_accepted.rrd...\e[97m" + sudo rrdtool tune ${DUMP1090_MESSAGES_LOCAL_RRD} 'RRA#6:=1440' 'RRA#7:=1440' 'RRA#8:=1440' + fi +fi + ### SETUP COMPLETE # Return to the project root directory.