Equalizer  1.6.1
statistic.h
1 
2 /* Copyright (c) 2009-2012, Stefan Eilemann <eile@equalizergraphics.com>
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
18 #ifndef EQ_STATISTIC_H
19 #define EQ_STATISTIC_H
20 
21 #include <eq/client/api.h>
22 #include <eq/client/types.h>
23 
24 #include <iostream>
25 
26 namespace eq
27 {
36  struct Statistic
37  {
39  enum Type // Also update string and color table in statistic.cpp
40  {
41  NONE = 0,
52 
55 
64 
66  ALL // must be last
67  };
68 
70  uint32_t frameNumber;
71  uint32_t task;
72  uint32_t plugins[2];
73 
74  int64_t startTime;
75  int64_t endTime;
76  int64_t idleTime;
77  int64_t totalTime;
78 
79  float ratio;
80  float currentFPS;
81  float averageFPS;
82  float pad;
83 
84  char resourceName[32];
85 
87  static const std::string& getName( const Type type );
89  static const Vector3f& getColor( const Type type );
90  };
91 
93  EQ_API std::ostream& operator << ( std::ostream&, const Statistic::Type& );
94 
96  EQ_API std::ostream& operator << ( std::ostream&, const Statistic& );
97 }
98 
99 namespace lunchbox
100 {
101 template<> inline void byteswap( eq::Statistic::Type& value )
102  { byteswap( reinterpret_cast< uint32_t& >( value )); }
103 
104 template<> inline void byteswap( eq::Statistic& value )
105 {
106  byteswap( value.type );
107  byteswap( value.frameNumber );
108  byteswap( value.task );
109  byteswap( value.plugins[0] );
110  byteswap( value.plugins[1] );
111 
112  byteswap( value.startTime );
113  byteswap( value.endTime );
114  byteswap( value.idleTime );
115  byteswap( value.totalTime );
116 
117  byteswap( value.ratio );
118  byteswap( value.currentFPS );
119  byteswap( value.averageFPS );
120 }
121 }
122 
123 #endif // EQ_STATISTIC_H
124 
int64_t startTime
Absolute start time of the operation.
Definition: statistic.h:74
Sampling of Config::finishFrame.
Definition: statistic.h:63
Type
The type of the statistics event.
Definition: statistic.h:39
Sampling of Frame::waitReady.
Definition: statistic.h:46
Sampling of Channel::frameAssemble.
Definition: statistic.h:45
Sampling of frame decompression.
Definition: statistic.h:61
int64_t idleTime
Absolute idle time of PIPE_IDLE.
Definition: statistic.h:76
Sampling of waiting for a send token from the receiver.
Definition: statistic.h:53
Sampling of Config::startFrame.
Definition: statistic.h:62
float currentFPS
FPS of last frame (WINDOW_FPS)
Definition: statistic.h:80
std::ostream & operator<<(std::ostream &os, const ConfigEvent *event)
Print the config event to the given output stream.
Sampling of frame transmission.
Definition: statistic.h:50
int64_t endTime
Absolute end time of the operation.
Definition: statistic.h:75
Pipe thread idle ratio.
Definition: statistic.h:60
Sampling of Channel::frameViewFinish.
Definition: statistic.h:49
uint32_t plugins[2]
color,depth plugins (readback, compression)
Definition: statistic.h:72
char resourceName[32]
A non-unique name of the originator.
Definition: statistic.h:84
float ratio
compression ratio (transfer, compression)
Definition: statistic.h:79
Sampling of frame compression.
Definition: statistic.h:51
A statistics event.
Definition: statistic.h:36
Sampling of synchronization time during Config::finishFrame.
Definition: statistic.h:65
static const std::string & getName(const Type type)
Translate the Type to a string representation.
Sampling of Window::swapBuffers.
Definition: statistic.h:58
Type type
The type of statistic.
Definition: statistic.h:69
Framerate sampling.
Definition: statistic.h:59
uint32_t frameNumber
The frame during when the sampling happened.
Definition: statistic.h:70
Sampling of Channel::frameReadback.
Definition: statistic.h:47
Sampling of async readback.
Definition: statistic.h:48
Sampling of Channel::frameClear.
Definition: statistic.h:42
float averageFPS
Weighted sum averaging of FPS (WINDOW_FPS)
Definition: statistic.h:81
Sampling of Channel::frameDraw.
Definition: statistic.h:43
Sampling of Window::finish before a swap barrier.
Definition: statistic.h:54
Sampling of Channel::frameDrawFinish.
Definition: statistic.h:44
Sampling of throttling of framerate_equalizer.
Definition: statistic.h:56
Sampling of swap barrier block.
Definition: statistic.h:57
static const Vector3f & getColor(const Type type)
Translate the Type to a color value.
int64_t totalTime
Total time of a pipe frame (PIPE_IDLE)
Definition: statistic.h:77