Equalizer  1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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 
A statistics event.
Definition: statistic.h:36
int64_t startTime
Absolute start time of the operation.
Definition: statistic.h:74
float currentFPS
FPS of last frame (WINDOW_FPS)
Definition: statistic.h:80
Sampling of synchronization time during Config::finishFrame.
Definition: statistic.h:65
int64_t totalTime
Total time of a pipe frame (PIPE_IDLE)
Definition: statistic.h:77
Sampling of Channel::frameClear.
Definition: statistic.h:42
char resourceName[32]
A non-unique name of the originator.
Definition: statistic.h:84
int64_t endTime
Absolute end time of the operation.
Definition: statistic.h:75
Sampling of Frame::waitReady.
Definition: statistic.h:46
EQ_API std::ostream & operator<<(std::ostream &os, const ConfigEvent *event)
Print the config event to the given output stream.
float ratio
compression ratio (transfer, compression)
Definition: statistic.h:79
Sampling of Channel::frameDrawFinish.
Definition: statistic.h:44
Sampling of swap barrier block.
Definition: statistic.h:57
uint32_t plugins[2]
color,depth plugins (readback, compression)
Definition: statistic.h:72
Sampling of Channel::frameViewFinish.
Definition: statistic.h:49
Sampling of throttling of framerate_equalizer.
Definition: statistic.h:56
Sampling of frame decompression.
Definition: statistic.h:61
static const std::string & getName(const Type type)
Translate the Type to a string representation.
Sampling of Config::startFrame.
Definition: statistic.h:62
Sampling of Channel::frameAssemble.
Definition: statistic.h:45
uint32_t frameNumber
The frame during when the sampling happened.
Definition: statistic.h:70
Sampling of Channel::frameDraw.
Definition: statistic.h:43
Framerate sampling.
Definition: statistic.h:59
int64_t idleTime
Absolute idle time of PIPE_IDLE.
Definition: statistic.h:76
Sampling of Config::finishFrame.
Definition: statistic.h:63
Pipe thread idle ratio.
Definition: statistic.h:60
Sampling of Channel::frameReadback.
Definition: statistic.h:47
Type type
The type of statistic.
Definition: statistic.h:69
Sampling of async readback.
Definition: statistic.h:48
Sampling of frame compression.
Definition: statistic.h:51
Sampling of frame transmission.
Definition: statistic.h:50
float averageFPS
Weighted sum averaging of FPS (WINDOW_FPS)
Definition: statistic.h:81
Type
The type of the statistics event.
Definition: statistic.h:39
Sampling of Window::swapBuffers.
Definition: statistic.h:58
static const Vector3f & getColor(const Type type)
Translate the Type to a color value.
Sampling of Window::finish before a swap barrier.
Definition: statistic.h:54
Sampling of waiting for a send token from the receiver.
Definition: statistic.h:53