Fawkes API Fawkes Development Version
syncpoint_call_stats.h
1/***************************************************************************
2 * syncpoint_call_stats.h - Utility class to keep track of SP call stats
3 *
4 * Created: Fri Aug 15 16:17:42 2014
5 * Copyright 2014 Till Hofmann
6 *
7 ****************************************************************************/
8
9/* This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Library General Public License for more details.
18 *
19 * Read the full text in the LICENSE.GPL file in the doc directory.
20 */
21
22#ifndef _SYNCPOINT_SYNCPOINT_CALL_STATS_H_
23#define _SYNCPOINT_SYNCPOINT_CALL_STATS_H_
24
25#include <syncpoint/syncpoint_call.h>
26#include <utils/time/time.h>
27
28namespace fawkes {
29
31{
32public:
34
35 void update_calls(const Time &new_call, const Time &wait_time = Time(0.f));
36 void update_calls(const SyncPointCall &call);
37 Time get_first_call() const;
38 Time get_last_call() const;
39 float get_call_frequency() const;
40 float get_waittime_average() const;
41 unsigned int get_num_calls() const;
42
43private:
44 Time first_call_;
45 Time last_call_;
46 Time total_wait_time_;
47 unsigned int num_calls_;
48};
49
50} // namespace fawkes
51
52#endif
This class represents call stats of a single component to a single SyncPoint.
float get_call_frequency() const
Get the call frequency.
void update_calls(const Time &new_call, const Time &wait_time=Time(0.f))
Add a call to the stats.
Time get_first_call() const
Get the first call to the SyncPoint by the component.
float get_waittime_average() const
Get the average wait time.
unsigned int get_num_calls() const
Get total number of calls.
Time get_last_call() const
Get the last call to the SyncPoint by the component.
A call (wait() or emit()) to a SyncPoint.
A class for handling time.
Definition: time.h:93
Fawkes library namespace.