ed
Public Member Functions | Private Attributes | List of all members
ed::LoopUsageStatus Class Reference

A diagnostic task that monitors the frequency of an event. More...

#include <loop_usage_status.h>

Inheritance diagram for ed::LoopUsageStatus:
Inheritance graph
[legend]

Public Member Functions

void clear ()
 Resets the statistics. More...
 
const tue::LoopTimergetTimer () const
 Expose const reference to loop timer. No call to the const timer will be able to influence the behaviour of this class. More...
 
 LoopUsageStatus (const diagnostic_updater::FrequencyStatusParam &params)
 Constructs a LoopUsageStatus class with the given parameters. Uses a default diagnostic task name of "Loop Usage Status". More...
 
 LoopUsageStatus (const diagnostic_updater::FrequencyStatusParam &params, std::string name)
 Constructs a LoopUsageStatus class with the given parameters. More...
 
virtual void run (diagnostic_updater::DiagnosticStatusWrapper &stat)
 Fills out this Task's DiagnosticStatusWrapper. More...
 
void start ()
 Signals that a start event has occurred. More...
 
void stop ()
 Signals that a stop event has occurred. More...
 

Private Attributes

long double duration_
 
std::vector< long double > durations_
 
int hist_indx_
 
boost::mutex lock_
 
const diagnostic_updater::FrequencyStatusParam params_
 
std::vector< int > seq_nums_
 
long double start_
 
std::vector< long double > starts_
 
tue::LoopTimer timer_
 

Detailed Description

A diagnostic task that monitors the frequency of an event.

This diagnostic task monitors the frequency and usage of a loop and creates corresponding diagnostics. It will report a warning if the frequency is outside acceptable bounds, and report an error if there have been no events in the latest window. Heavily inspired by diagnostic_updater::FrequencyStatus

Definition at line 27 of file loop_usage_status.h.

Constructor & Destructor Documentation

◆ LoopUsageStatus() [1/2]

ed::LoopUsageStatus::LoopUsageStatus ( const diagnostic_updater::FrequencyStatusParam &  params,
std::string  name 
)
inline

Constructs a LoopUsageStatus class with the given parameters.

Definition at line 46 of file loop_usage_status.h.

◆ LoopUsageStatus() [2/2]

ed::LoopUsageStatus::LoopUsageStatus ( const diagnostic_updater::FrequencyStatusParam &  params)
inline

Constructs a LoopUsageStatus class with the given parameters. Uses a default diagnostic task name of "Loop Usage Status".

Definition at line 58 of file loop_usage_status.h.

Member Function Documentation

◆ clear()

void ed::LoopUsageStatus::clear ( )
inline

Resets the statistics.

Definition at line 74 of file loop_usage_status.h.

◆ getTimer()

const tue::LoopTimer& ed::LoopUsageStatus::getTimer ( ) const
inline

Expose const reference to loop timer. No call to the const timer will be able to influence the behaviour of this class.

Returns
const reference to the loop timer

Definition at line 69 of file loop_usage_status.h.

◆ run()

virtual void ed::LoopUsageStatus::run ( diagnostic_updater::DiagnosticStatusWrapper &  stat)
inlinevirtual

Fills out this Task's DiagnosticStatusWrapper.

Definition at line 108 of file loop_usage_status.h.

◆ start()

void ed::LoopUsageStatus::start ( )
inline

Signals that a start event has occurred.

Definition at line 90 of file loop_usage_status.h.

◆ stop()

void ed::LoopUsageStatus::stop ( )
inline

Signals that a stop event has occurred.

Definition at line 99 of file loop_usage_status.h.

Member Data Documentation

◆ duration_

long double ed::LoopUsageStatus::duration_
private

Definition at line 38 of file loop_usage_status.h.

◆ durations_

std::vector<long double> ed::LoopUsageStatus::durations_
private

Definition at line 34 of file loop_usage_status.h.

◆ hist_indx_

int ed::LoopUsageStatus::hist_indx_
private

Definition at line 36 of file loop_usage_status.h.

◆ lock_

boost::mutex ed::LoopUsageStatus::lock_
private

Definition at line 40 of file loop_usage_status.h.

◆ params_

const diagnostic_updater::FrequencyStatusParam ed::LoopUsageStatus::params_
private

Definition at line 30 of file loop_usage_status.h.

◆ seq_nums_

std::vector<int> ed::LoopUsageStatus::seq_nums_
private

Definition at line 35 of file loop_usage_status.h.

◆ start_

long double ed::LoopUsageStatus::start_
private

Definition at line 37 of file loop_usage_status.h.

◆ starts_

std::vector<long double> ed::LoopUsageStatus::starts_
private

Definition at line 33 of file loop_usage_status.h.

◆ timer_

tue::LoopTimer ed::LoopUsageStatus::timer_
private

Definition at line 32 of file loop_usage_status.h.


The documentation for this class was generated from the following file: