<commit_before>#!/bin/bash

# Assign the Lighthttpd document root directory to a variable.
RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
DOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< $RAWDOCUMENTROOT`

renice -n 5 -p $$

## DUMP1090 GRAPHS

aircraft_graph() {
  rrdtool graph \
  "$1" \
  --start end-$4 \
  --width 480 \
  --height 200 \
  --step "$5" \
  --title "$3 Aircraft Seen / Tracked" \
  --vertical-label "Aircraft" \
  --lower-limit 0 \
  --units-exponent 0 \
  "TEXTALIGN:center" \
  "DEF:all=$2/dump1090_aircraft-recent.rrd:total:AVERAGE" \
  "DEF:pos=$2/dump1090_aircraft-recent.rrd:positions:AVERAGE" \
  "DEF:mlat=$2/dump1090_mlat-recent.rrd:value:AVERAGE" \
  "CDEF:noloc=all,pos,-" \
  "VDEF:avgac=all,AVERAGE" \
  "VDEF:maxac=all,MAXIMUM" \
  "AREA:all#00FF00:Aircraft Seen / Tracked,   " \
  "GPRINT:avgac:Average\:%3.0lf     " \
  "GPRINT:maxac:Maximum\:%3.0lf             " \
  "LINE1:pos#0000FF:w/ Positions" \
  "LINE1:noloc#FF0000:w/o Positions" \
  "LINE1:mlat#000000:mlat" \
  --watermark "Drawn: $nowlit";
}

aircraft_message_rate_graph() {
  rrdtool graph \
  "$1" \
  --start end-$4 \
  --width 480 \
  --height 200 \
  --step "$5" \
  --title "$3 Message Rate / Aircraft" \
  --vertical-label "Messages/Aircraft/Second" \
  --lower-limit 0 \
  --units-exponent 0 \
  "TEXTALIGN:center" \
  "DEF:aircrafts=$2/dump1090_aircraft-recent.rrd:total:AVERAGE" \
  "DEF:messages=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE" \
  "CDEF:rate-provisional=messages,aircrafts,/" \
  "CDEF:rate=aircrafts,0,GT,rate-provisional,0,IF" \
  "VDEF:avgrate=rate,AVERAGE" \
  "VDEF:maxrate=rate,MAXIMUM" \
  "LINE1:rate#0000FF:Messages / AC" \
  "LINE1:avgrate#666666:Average\::dashes" \
  "GPRINT:avgrate:%3.1lf" \
  "LINE1:maxrate#FF0000:Maximum\:" \
  "GPRINT:maxrate:%3.1lf\c" \
  "LINE1:aircrafts#990000:Aircraft Seen / Tracked \c" \
  --watermark "Drawn: $nowlit";
}

cpu_graph_dump1090() {
  rrdtool graph \
  "$1" \
  --start end-$4 \
  --width 480 \
  --height 200 \
  --step "$5" \
  --title "$3 CPU Utilization" \
  --vertical-label "CPU %" \
  --lower-limit 0 \
  --rigid \
  "DEF:demod=$2/dump1090_cpu-demod.rrd:value:AVERAGE" \
  "CDEF:demodp=demod,10,/" \
  "DEF:reader=$2/dump1090_cpu-reader.rrd:value:AVERAGE" \
  "CDEF:readerp=reader,10,/" \
  "DEF:background=$2/dump1090_cpu-background.rrd:value:AVERAGE" \
  "CDEF:backgroundp=background,10,/" \
  "AREA:readerp#008000:USB" \
  "AREA:backgroundp#00C000:Other:STACK" \
  "AREA:demodp#00FF00:Demodulator\c:STACK" \<commit_msg>Update aircraft message rate graph <commit_after>#!/bin/bash

# Assign the Lighthttpd document root directory to a variable.
RAWDOCUMENTROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
DOCUMENTROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< $RAWDOCUMENTROOT`

renice -n 5 -p $$

## DUMP1090 GRAPHS

aircraft_graph() {
  rrdtool graph \
  "$1" \
  --start end-$4 \
  --width 480 \
  --height 200 \
  --step "$5" \
  --title "$3 Aircraft Seen / Tracked" \
  --vertical-label "Aircraft" \
  --lower-limit 0 \
  --units-exponent 0 \
  "TEXTALIGN:center" \
  "DEF:all=$2/dump1090_aircraft-recent.rrd:total:AVERAGE" \
  "DEF:pos=$2/dump1090_aircraft-recent.rrd:positions:AVERAGE" \
  "DEF:mlat=$2/dump1090_mlat-recent.rrd:value:AVERAGE" \
  "CDEF:noloc=all,pos,-" \
  "VDEF:avgac=all,AVERAGE" \
  "VDEF:maxac=all,MAXIMUM" \
  "AREA:all#00FF00:Aircraft Seen / Tracked,   " \
  "GPRINT:avgac:Average\:%3.0lf     " \
  "GPRINT:maxac:Maximum\:%3.0lf             " \
  "LINE1:pos#0000FF:w/ Positions" \
  "LINE1:noloc#FF0000:w/o Positions" \
  "LINE1:mlat#000000:mlat" \
  --watermark "Drawn: $nowlit";
}

aircraft_message_rate_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 428 \
--height 200 \
--step "$5" \
--title "$3 Message Rate / Aircraft" \
--vertical-label "Aircraft" \
--right-axis-label "Messages/Aircraft/Second" \
--lower-limit 0 \
--units-exponent 0 \
--right-axis 0.1:0 \
"TEXTALIGN:center" \
"DEF:aircrafts=$2/dump1090_aircraft-recent.rrd:total:AVERAGE" \
"DEF:messages=$2/dump1090_messages-local_accepted.rrd:value:AVERAGE" \
"CDEF:rate-provisional=messages,aircrafts,/" \
"CDEF:rate=aircrafts,0,GT,rate-provisional,0,IF" \
"CDEF:rate10=rate,10,*" \
"VDEF:avgrate=rate,AVERAGE" \
"VDEF:maxrate=rate,MAXIMUM" \
"VDEF:avgrate10=rate10,AVERAGE" \
"VDEF:maxrate10=rate10,MAXIMUM" \
"LINE1:rate10#0000FF:Messages / AC (RHS)" \
"LINE1:avgrate10#666666:Average:dashes" \
"GPRINT:avgrate:%3.1lf" \
"LINE1:maxrate10#FF0000:Maximum:" \
"GPRINT:maxrate:%3.1lf\c" \
"LINE1:aircrafts#990000:Aircraft Seen / Tracked \c" \
--watermark "Drawn: $nowlit";
}

cpu_graph_dump1090() {
  rrdtool graph \
  "$1" \
  --start end-$4 \
  --width 480 \
  --height 200 \
  --step "$5" \
  --title "$3 CPU Utilization" \
  --vertical-label "CPU %" \
  --lower-limit 0 \
  --rigid \
  "DEF:demod=$2/dump1090_cpu-demod.rrd:value:AVERAGE" \
  "CDEF:demodp=demod,10,/" \
  "DEF:reader=$2/dump1090_cpu-reader.rrd:value:AVERAGE" \
  "CDEF:readerp=reader,10,/" \
  "DEF:background=$2/dump1090_cpu-background.rrd:value:AVERAGE" \
  "CDEF:backgroundp=background,10,/" \
  "AREA:readerp#008000:USB" \
  "AREA:backgroundp#00C000:Other:STACK" \
  "AREA:demodp#00FF00:Demodulator\c:STACK" \
{'fraction_non_alphanumeric': 0.1961977186311787, 'fraction_numerical': 0.06520912547528517, 'mean_word_length': 3.5668402777777777, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7238541', 'n_tokens_mistral': 2540, 'n_tokens_neox': 2341, 'n_words': 295}