Skip to content
Snippets Groups Projects

Resolve "Basic processor and solver profiling"

Merged Joan Vallvé Navarro requested to merge 375-basig-processor-and-solver-profiling into devel
5 files
+ 50
0
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -18,6 +18,7 @@ class SensorBase;
// std
#include <memory>
#include <map>
#include <chrono>
namespace wolf {
@@ -265,6 +266,14 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce
unsigned int id() const;
// PROFILING
unsigned int n_capture_callback_;
unsigned int n_kf_callback_;
std::chrono::microseconds duration_;
std::chrono::time_point<std::chrono::high_resolution_clock> start_;
void startProfiling();
void stopProfiling();
protected:
/** \brief process an incoming capture
*
@@ -384,6 +393,16 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce
bool check(CheckLog& _log, std::shared_ptr<NodeBase> _node_ptr, bool _verbose, std::ostream& _stream, std::string _tabs = "") const;
};
inline void ProcessorBase::startProfiling()
{
start_ = std::chrono::high_resolution_clock::now();
}
inline void ProcessorBase::stopProfiling()
{
duration_ += std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - start_);
}
inline bool ProcessorBase::isVotingActive() const
{
return params_->voting_active;
Loading