From 92bed4e9ce6abb99647842cedf9f6b9b5cb01df9 Mon Sep 17 00:00:00 2001 From: charlie-foxtrot <13514783+charlie-foxtrot@users.noreply.github.com> Date: Wed, 20 Apr 2022 14:57:16 -0700 Subject: [PATCH 1/2] add channel_squelch_level to stats output file --- src/output.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/output.cpp b/src/output.cpp index 07e5178..1c46293 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -621,6 +621,23 @@ static void output_channel_signal_levels(FILE *f) { fprintf(f, "\n"); } +static void output_channel_squelch_levels(FILE *f) { + fprintf(f, "# HELP channel_squelch_level Squelch squelch_level.\n" + "# TYPE channel_squelch_level gauge\n"); + + for (int i = 0; i < device_count; i++) { + device_t* dev = devices + i; + for (int j = 0; j < dev->channel_count; j++) { + channel_t* channel = devices[i].channels + j; + for (int k = 0; k < channel->freq_count; k++) { + print_channel_metric(f, "channel_squelch_level", channel->freqlist[k].frequency, channel->freqlist[k].label); + fprintf(f, "\t%.3f\n", channel->freqlist[k].squelch.squelch_level()); + } + } + } + fprintf(f, "\n"); +} + static void output_channel_squelch_counter(FILE *f) { fprintf(f, "# HELP channel_squelch_counter Squelch open_count.\n" "# TYPE channel_squelch_counter counter\n"); From 69f35b311059b0942e7726fb09ff92a97f8d4954 Mon Sep 17 00:00:00 2001 From: charlie-foxtrot <13514783+charlie-foxtrot@users.noreply.github.com> Date: Wed, 20 Apr 2022 15:26:55 -0700 Subject: [PATCH 2/2] add output call --- src/output.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output.cpp b/src/output.cpp index 1c46293..7784fb5 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -758,6 +758,7 @@ void write_stats_file(timeval *last_stats_write) { output_channel_noise_levels(file); output_channel_signal_levels(file); output_channel_squelch_counter(file); + output_channel_squelch_levels(file); output_channel_flappy_counter(file); output_device_buffer_overflows(file); output_output_overruns(file);