Equalizer  1.9.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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_FABRIC_STATISTIC_H
19 #define EQ_FABRIC_STATISTIC_H
20 
21 #include <eq/fabric/api.h>
22 #include <eq/fabric/types.h>
23 
24 #include <iostream>
25 
26 namespace eq
27 {
28 namespace fabric
29 {
30 
39 struct Statistic
40 {
42  enum Type // Also update string and color table in statistic.cpp
43  {
44  NONE = 0,
55 
58 
67 
69  ALL // must be last
70  };
71 
73  uint32_t frameNumber;
74  uint32_t task;
75  uint32_t plugins[2];
76 
77  int64_t startTime;
78  int64_t endTime;
79  int64_t idleTime;
80  int64_t totalTime;
81 
82  float ratio;
83  float currentFPS;
84  float averageFPS;
85  float pad;
86 
87  char resourceName[32];
88 
90  EQFABRIC_API static const std::string& getName( const Type type );
92  EQFABRIC_API static const Vector3f& getColor( const Type type );
93 };
94 
96 EQFABRIC_API std::ostream& operator << ( std::ostream&, const Statistic::Type&);
97 
99 EQFABRIC_API std::ostream& operator << ( std::ostream&, const Statistic& );
100 
101 }
102 }
103 
104 namespace lunchbox
105 {
106 template<> inline void byteswap( eq::fabric::Statistic::Type& value )
107  { byteswap( reinterpret_cast< uint32_t& >( value )); }
108 
109 template<> inline void byteswap( eq::fabric::Statistic& value )
110 {
111  byteswap( value.type );
112  byteswap( value.frameNumber );
113  byteswap( value.task );
114  byteswap( value.plugins[0] );
115  byteswap( value.plugins[1] );
116 
117  byteswap( value.startTime );
118  byteswap( value.endTime );
119  byteswap( value.idleTime );
120  byteswap( value.totalTime );
121 
122  byteswap( value.ratio );
123  byteswap( value.currentFPS );
124  byteswap( value.averageFPS );
125 }
126 }
127 
128 #endif // EQ_FABRIC_STATISTIC_H
129 
Sampling of synchronization time during Config::finishFrame.
Definition: statistic.h:68
Sampling of Channel::frameReadback.
Definition: statistic.h:50
uint32_t plugins[2]
color,depth plugins (readback, compression)
Definition: statistic.h:75
Sampling of waiting for a send token from the receiver.
Definition: statistic.h:56
Sampling of Channel::frameDrawFinish.
Definition: statistic.h:47
Sampling of Channel::frameClear.
Definition: statistic.h:45
Sampling of Channel::frameViewFinish.
Definition: statistic.h:52
Sampling of Config::startFrame.
Definition: statistic.h:65
Sampling of Window::finish before a swap barrier.
Definition: statistic.h:57
int64_t startTime
Absolute start time of the operation.
Definition: statistic.h:77
Sampling of Frame::waitReady.
Definition: statistic.h:49
static EQFABRIC_API const std::string & getName(const Type type)
Translate the Type to a string representation.
Sampling of frame compression.
Definition: statistic.h:54
static EQFABRIC_API const Vector3f & getColor(const Type type)
Translate the Type to a color value.
Type
The type of the statistics event.
Definition: statistic.h:42
uint32_t frameNumber
The frame during when the sampling happened.
Definition: statistic.h:73
Sampling of frame decompression.
Definition: statistic.h:64
float currentFPS
FPS of last frame (WINDOW_FPS)
Definition: statistic.h:83
Sampling of swap barrier block.
Definition: statistic.h:60
Type type
The type of statistic.
Definition: statistic.h:72
Sampling of Channel::frameDraw.
Definition: statistic.h:46
int64_t totalTime
Total time of a pipe frame (PIPE_IDLE)
Definition: statistic.h:80
char resourceName[32]
A non-unique name of the originator.
Definition: statistic.h:87
Sampling of Window::swapBuffers.
Definition: statistic.h:61
int64_t idleTime
Absolute idle time of PIPE_IDLE.
Definition: statistic.h:79
float ratio
compression ratio (transfer, compression)
Definition: statistic.h:82
Sampling of throttling of framerate_equalizer.
Definition: statistic.h:59
float averageFPS
Weighted sum averaging of FPS (WINDOW_FPS)
Definition: statistic.h:84
A statistics event.
Definition: statistic.h:39
int64_t endTime
Absolute end time of the operation.
Definition: statistic.h:78
Sampling of async readback.
Definition: statistic.h:51
Sampling of Config::finishFrame.
Definition: statistic.h:66
Sampling of Channel::frameAssemble.
Definition: statistic.h:48
Framerate sampling.
Definition: statistic.h:62
Sampling of frame transmission.
Definition: statistic.h:53
Pipe thread idle ratio.
Definition: statistic.h:63