17 #ifndef _GAZEBO_UTIL_DIAGNOSTICMANAGER_HH_
18 #define _GAZEBO_UTIL_DIAGNOSTICMANAGER_HH_
21 #include <boost/filesystem.hpp>
23 #include "gazebo/gazebo_config.h"
37 class DiagnosticManagerPrivate;
40 class DiagnosticTimerPrivate;
45 #ifdef ENABLE_DIAGNOSTICS
46 #define DIAG_TIMER_START(_name) \
50 gazebo::util::DiagnosticManager::Instance()->StartTimer(_name);
57 #define DIAG_TIMER_LAP(_name, _prefix) \
58 gazebo::util::DiagnosticManager::Instance()->Lap(_name, _prefix);
62 #define DIAG_TIMER_STOP(_name) \
63 gazebo::util::DiagnosticManager::Instance()->StopTimer(_name);
65 #define DIAG_TIMER_START(_name) ((void) 0)
66 #define DIAG_TIMER_LAP(_name, _prefix) ((void)0)
67 #define DIAG_TIMER_STOP(_name) ((void) 0)
83 public:
void Init(
const std::string &_worldName);
88 public:
void StartTimer(
const std::string &_name);
92 public:
void StopTimer(
const std::string &_name);
99 public:
void Lap(
const std::string &_name,
const std::string &_prefix);
108 public:
int TimerCount()
const;
125 public:
common::Time GetTime(
const std::string &_label)
const
131 public:
common::Time Time(
const std::string &_label)
const;
142 public: std::string Label(
const int _index)
const;
151 public: boost::filesystem::path LogPath()
const;
162 private:
void AddTime(
const std::string &_name,
174 private: std::unique_ptr<DiagnosticManagerPrivate> dataPtr;
190 public:
void Lap(
const std::string &_prefix);
193 public:
virtual void Start();
196 public:
virtual void Stop();
205 public:
const std::string Name()
const;
209 private: std::unique_ptr<DiagnosticTimerPrivate> dataPtr;
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:48
Singleton template class.
Definition: SingletonT.hh:33
A diagnostic manager class.
Definition: util/Diagnostics.hh:72
Information for use in an update event.
Definition: UpdateInfo.hh:30
#define GZ_UTIL_VISIBLE
Definition: system.hh:234
A timer class, used to time things in real world walltime.
Definition: Timer.hh:38
A timer designed for diagnostics.
Definition: util/Diagnostics.hh:179
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44