1 |
/* |
---|
2 |
* Copyright (C) 2005-2008 by Pieter Palmers |
---|
3 |
* |
---|
4 |
* This file is part of FFADO |
---|
5 |
* FFADO = Free Firewire (pro-)audio drivers for linux |
---|
6 |
* |
---|
7 |
* FFADO is based upon FreeBoB. |
---|
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) version 3 of the License. |
---|
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 General Public License for more details. |
---|
18 |
* |
---|
19 |
* You should have received a copy of the GNU General Public License |
---|
20 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
21 |
* |
---|
22 |
*/ |
---|
23 |
|
---|
24 |
#ifndef FFADOSTREAMINGSTREAMSTATISTICS_H |
---|
25 |
#define FFADOSTREAMINGSTREAMSTATISTICS_H |
---|
26 |
|
---|
27 |
#include <string> |
---|
28 |
|
---|
29 |
#include "debugmodule/debugmodule.h" |
---|
30 |
|
---|
31 |
#define MAX_SIGNAL_VALUE 7 |
---|
32 |
namespace Streaming { |
---|
33 |
|
---|
34 |
class StreamStatistics { |
---|
35 |
public: |
---|
36 |
StreamStatistics(); |
---|
37 |
|
---|
38 |
~StreamStatistics() {}; |
---|
39 |
|
---|
40 |
void setName(std::string n) {m_name=n;}; |
---|
41 |
|
---|
42 |
void mark(int value); |
---|
43 |
|
---|
44 |
void dumpInfo(); |
---|
45 |
void reset(); |
---|
46 |
|
---|
47 |
std::string m_name; |
---|
48 |
|
---|
49 |
int64_t m_count; |
---|
50 |
float m_average; |
---|
51 |
int64_t m_min; |
---|
52 |
int64_t m_max; |
---|
53 |
int64_t m_sum; |
---|
54 |
|
---|
55 |
// some tools to do run statistics |
---|
56 |
// will keep a histogram of the number of times a certain value |
---|
57 |
// is added. |
---|
58 |
void signal(unsigned int val); |
---|
59 |
|
---|
60 |
unsigned int m_signalled[MAX_SIGNAL_VALUE+1]; |
---|
61 |
|
---|
62 |
private: |
---|
63 |
DECLARE_DEBUG_MODULE; |
---|
64 |
}; |
---|
65 |
|
---|
66 |
} |
---|
67 |
|
---|
68 |
#endif |
---|