Skip to content
Snippets Groups Projects
Commit 2df5d183 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

[skip ci] better profiling print

parent 91314ead
No related branches found
No related tags found
1 merge request!448Draft: Resolve "Implementation of new nodes creation"
Pipeline #20337 skipped
...@@ -240,19 +240,38 @@ bool ProcessorBase::check(CheckLog& _log, bool _verbose, std::ostream& _stream, ...@@ -240,19 +240,38 @@ bool ProcessorBase::check(CheckLog& _log, bool _verbose, std::ostream& _stream,
void ProcessorBase::printProfiling(std::ostream& _stream) const void ProcessorBase::printProfiling(std::ostream& _stream) const
{ {
unsigned int kf_average_period =
(n_kf_callback_ > 0) ? std::round(100 * capture_period_mean_ * n_capture_callback_ / n_kf_callback_) : 0;
unsigned int average_proc_cap_percent =
(n_capture_callback_ > 0)
? std::round(100 * acc_duration_capture_.count() / n_capture_callback_ / capture_period_mean_)
: 0;
unsigned int max_proc_cap_percent =
(n_capture_callback_ > 0) ? std::round(100 * max_duration_capture_.count() / capture_period_min_) : 0;
unsigned int average_proc_kf_percent =
(n_kf_callback_ > 0) ? std::round(100 * acc_duration_kf_.count() / n_kf_callback_ / kf_average_period) : 0;
unsigned int max_proc_kf_percent =
(n_kf_callback_ > 0) ? std::round(100 * max_duration_kf_.count() / kf_average_period) : 0;
_stream << "\n" _stream << "\n"
<< getType() << " - " << getName() << ":" << getType() << " - " << getName() << ":"
<< "\n\ttotal time: " << 1e-6 * (acc_duration_capture_ + acc_duration_kf_).count() << " s" << "\n\ttotal proc. time: " << 1e-6 * (acc_duration_capture_ + acc_duration_kf_).count() << " s"
<< "\n\tProcessing captures:" << "\n\tProcessing captures:"
<< "\n\t\ttotal time: " << 1e-6 * acc_duration_capture_.count() << " s"
<< "\n\t\tcaptures processed: " << n_capture_callback_ << "\n\t\tcaptures processed: " << n_capture_callback_
<< "\n\t\taverage time: " << 1e-3 * acc_duration_capture_.count() / n_capture_callback_ << " ms" << "\n\t\taverage period: " << 1e-3 * capture_period_mean_ << " ms"
<< "\n\t\tmax time: " << 1e-3 * max_duration_capture_.count() << " ms" << "\n\t\ttotal proc. time: " << 1e-6 * acc_duration_capture_.count() << " s"
<< "\n\t\taverage proc. time: " << 1e-3 * acc_duration_capture_.count() / n_capture_callback_ << " ms"
<< " (" << average_proc_cap_percent << "%)"
<< "\n\t\tmax proc. time: " << 1e-3 * max_duration_capture_.count() << " ms"
<< " (" << max_proc_cap_percent << "%)"
<< "\n\tProcessing keyframes:" << "\n\tProcessing keyframes:"
<< "\n\t\ttotal time: " << 1e-6 * acc_duration_kf_.count() << " s"
<< "\n\t\tkf processed: " << n_kf_callback_ << "\n\t\tkf processed: " << n_kf_callback_
<< "\n\t\taverage time: " << 1e-3 * acc_duration_kf_.count() / n_kf_callback_ << " ms" << "\n\t\taverage period: " << 1e-3 * kf_average_period << " ms"
<< "\n\t\tmax time: " << 1e-3 * max_duration_kf_.count() << " ms" << std::endl; << "\n\t\ttotal proc. time: " << 1e-6 * acc_duration_kf_.count() << " s"
<< "\n\t\taverage proc. time: " << 1e-3 * acc_duration_kf_.count() / n_kf_callback_ << " ms"
<< " (" << average_proc_kf_percent << "%)"
<< "\n\t\tmax proc. time: " << 1e-3 * max_duration_kf_.count() << " ms"
<< " (" << max_proc_kf_percent << "%)" << std::endl;
} }
bool ProcessorBase::checkTimeTolerance(const TimeStamp& _ts1, const TimeStamp& _ts2) const bool ProcessorBase::checkTimeTolerance(const TimeStamp& _ts1, const TimeStamp& _ts2) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment