aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/stats_edi2edi_munin.py2
-rw-r--r--src/EDISender.cpp8
-rw-r--r--src/EDISender.h1
-rw-r--r--src/main.cpp8
4 files changed, 15 insertions, 4 deletions
diff --git a/doc/stats_edi2edi_munin.py b/doc/stats_edi2edi_munin.py
index d2aa818..ce00de5 100644
--- a/doc/stats_edi2edi_munin.py
+++ b/doc/stats_edi2edi_munin.py
@@ -57,7 +57,7 @@ late.warning 0:0
def parse_logs():
# example lines:
- # Buffering time statistics [milliseconds]: min: 907.799 max: 981.409 mean: 944.335 stdev: 26.827 late: 0 of 250 (0%)
+ # Buffering time statistics [milliseconds]: min: 907.799 max: 981.409 mean: 944.335 stdev: 26.827 late: 0 of 250 (0%) Frame 0 TS 694
# Values might also be in scientific form, e.g. -1.80938e+07
re_logline = re.compile(r"""Buffering time statistics.* min: (.+) max: (.+) mean: (.+) stdev: (.+) late: (.+) of 250""", flags=re.ASCII)
diff --git a/src/EDISender.cpp b/src/EDISender.cpp
index 7c9eabf..38a5fa7 100644
--- a/src/EDISender.cpp
+++ b/src/EDISender.cpp
@@ -124,9 +124,11 @@ void EDISender::process()
break;
}
+ const uint16_t dflc = tagpacket.dflc;
+ const auto tsta = tagpacket.timestamp.tsta;
send_tagpacket(tagpacket);
- if (buffering_stats.size() == 250) { // every six seconds
+ if (dflc % 250 == 0) { // every six seconds
const double n = buffering_stats.size();
size_t num_late = std::count_if(buffering_stats.begin(), buffering_stats.end(),
@@ -173,7 +175,9 @@ void EDISender::process()
" stdev: " << stdev <<
" late: " <<
num_late << " of " << buffering_stats.size() << " (" <<
- num_late * 100.0 / n << "%)";
+ num_late * 100.0 / n << "%)" <<
+ " Frame 0 TS " << ((double)tsta / 16384.0);
+
buffering_stats.clear();
}
diff --git a/src/EDISender.h b/src/EDISender.h
index 5f053ea..bf688c8 100644
--- a/src/EDISender.h
+++ b/src/EDISender.h
@@ -40,6 +40,7 @@
struct tagpacket_t {
+ uint16_t dflc;
std::vector<uint8_t> tagpacket;
EdiDecoder::frame_timestamp_t timestamp;
std::chrono::steady_clock::time_point received_at;
diff --git a/src/main.cpp b/src/main.cpp
index 43cae90..6cf14f8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -101,7 +101,10 @@ class Main : public EdiDecoder::ETIDataCollector {
uint16_t minor) override { }
// Update the data for the frame characterisation
- virtual void update_fc_data(const EdiDecoder::eti_fc_data& fc_data) override { }
+ virtual void update_fc_data(const EdiDecoder::eti_fc_data& fc_data) override {
+ dflc = fc_data.dflc;
+ }
+
virtual void update_fic(std::vector<uint8_t>&& fic) override { }
virtual void update_err(uint8_t err) override { }
@@ -116,6 +119,7 @@ class Main : public EdiDecoder::ETIDataCollector {
virtual void assemble(EdiDecoder::ReceivedTagPacket&& tag_data) override
{
tagpacket_t tp;
+ tp.dflc = dflc;
tp.tagpacket = move(tag_data.tagpacket);
tp.received_at = std::chrono::steady_clock::now();
tp.timestamp = move(tag_data.timestamp);
@@ -344,6 +348,8 @@ class Main : public EdiDecoder::ETIDataCollector {
std::string source;
EDISender edisender;
+
+ uint16_t dflc = 0;
};