[hamradio-commits] [dump1090] 337/389: Add stats for number of sample blocks processed and dropped.

Matthew Ernisse mernisse-guest at moszumanska.debian.org
Wed Nov 5 00:20:12 UTC 2014


This is an automated email from the git hooks/post-receive script.

mernisse-guest pushed a commit to branch master
in repository dump1090.

commit 4fc26975556b771d36abf5667751a9ba56e5a092
Author: Oliver Jowett <oliver at mutability.co.uk>
Date:   Thu Sep 25 20:35:54 2014 +0100

    Add stats for number of sample blocks processed and dropped.
---
 dump1090.c | 7 ++++++-
 dump1090.h | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/dump1090.c b/dump1090.c
index c129fd4..00f21d8 100644
--- a/dump1090.c
+++ b/dump1090.c
@@ -492,6 +492,10 @@ static void display_stats(void) {
         interactiveShowData();
 
     printf("Statistics as at %s", ctime(&now));
+    printf("%d sample blocks processed\n",                    Modes.stat_blocks_processed);
+    printf("%d sample blocks dropped\n",                      Modes.stat_blocks_dropped);
+    Modes.stat_blocks_processed =
+        Modes.stat_blocks_dropped = 0;
 
     printf("%d ModeA/C detected\n",                           Modes.stat_ModeAC);
     printf("%d valid Mode-S preambles\n",                     Modes.stat_valid_preamble);
@@ -838,6 +842,7 @@ int main(int argc, char **argv) {
             // If we lost some blocks, correct the timestamp
             if (Modes.iDataLost) {
                 Modes.timestampBlk += (MODES_ASYNC_BUF_SAMPLES * 6 * Modes.iDataLost);
+                Modes.stat_blocks_dropped += Modes.iDataLost;
                 Modes.iDataLost = 0;
             }
 
@@ -852,7 +857,7 @@ int main(int argc, char **argv) {
 
             // Update the timestamp ready for the next block
             Modes.timestampBlk += (MODES_ASYNC_BUF_SAMPLES*6);
-
+            Modes.stat_blocks_processed++;
         } else {
             pthread_cond_signal (&Modes.data_cond);
             pthread_mutex_unlock(&Modes.data_mutex);
diff --git a/dump1090.h b/dump1090.h
index 77584bb..1339382 100644
--- a/dump1090.h
+++ b/dump1090.h
@@ -366,6 +366,9 @@ struct {                             // Internal state
     unsigned int stat_DF_Len_Corrected;
     unsigned int stat_DF_Type_Corrected;
     unsigned int stat_ModeAC;
+
+    unsigned int stat_blocks_processed;
+    unsigned int stat_blocks_dropped;
 } Modes;
 
 // The struct we use to store information about a decoded message.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090.git



More information about the pkg-hamradio-commits mailing list