Skip to content

Commit

Permalink
Log t1-t4
Browse files Browse the repository at this point in the history
  • Loading branch information
baranovmv committed Dec 2, 2024
1 parent a54a532 commit ee7cfea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 12 additions & 5 deletions src/internal_modules/roc_rtcp/rtt_estimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,30 @@ void RttEstimator::update(core::nanoseconds_t local_report_ts,
rtt_stats_.add(p);
RttOffsetPair min = rtt_stats_.mov_min();

metrics_.clock_offset = min.offset;
metrics_.rtt = min.rtt;
metrics_.clock_offset = clock_offset;
metrics_.rtt = rtt;
// metrics_.clock_offset = min.offset;
// metrics_.rtt = min.rtt;

has_metrics_ = true;

if (dumper_) {
dump_();
dump_(local_report_ts, remote_report_ts, remote_reply_ts, local_reply_ts);
}
}

void RttEstimator::dump_() {
void RttEstimator::dump_(core::nanoseconds_t local_report_ts, core::nanoseconds_t remote_report_ts,
core::nanoseconds_t remote_reply_ts, core::nanoseconds_t local_reply_ts) {
dbgio::CsvEntry e;
e.type = 'r';
e.n_fields = 3;
e.n_fields = 7;
e.fields[0] = core::timestamp(core::ClockUnix);
e.fields[1] = metrics_.rtt;
e.fields[2] = metrics_.clock_offset;
e.fields[3] = local_report_ts;
e.fields[4] = remote_report_ts;
e.fields[5] = remote_reply_ts;
e.fields[6] = local_reply_ts;
dumper_->write(e);
}

Expand Down
3 changes: 2 additions & 1 deletion src/internal_modules/roc_rtcp/rtt_estimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class RttEstimator {
core::nanoseconds_t local_reply_ts);

private:
void dump_();
void dump_(core::nanoseconds_t local_report_ts, core::nanoseconds_t remote_report_ts,
core::nanoseconds_t remote_reply_ts, core::nanoseconds_t local_reply_ts);

const RttConfig config_;
RttMetrics metrics_;
Expand Down

0 comments on commit ee7cfea

Please sign in to comment.