Equalizer  2.0.0
Parallel Rendering Framework
statistic.h
1 
2 /* Copyright (c) 2009-2016, 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/event.h> // base class
23 #include <eq/fabric/types.h>
24 #include <lunchbox/bitOperation.h> // inline template specialization
25 #include <iostream>
26 
27 namespace eq
28 {
29 namespace fabric
30 {
31 
41 struct Statistic : public Event
42 {
44  enum Type // Also update string and color table in statistic.cpp
45  {
46  NONE = 0,
57 
60 
69 
71  ALL // must be last
72  };
73 
75  uint32_t frameNumber;
76  uint32_t task;
77  uint32_t plugins[2];
78 
79  int64_t startTime;
80  int64_t endTime;
81  int64_t idleTime;
82  int64_t totalTime;
83 
84  float ratio;
85  float currentFPS;
86  float averageFPS;
87  float pad;
88 
89  char resourceName[32];
90 
92  EQFABRIC_API static const std::string& getName( const Type type );
94  EQFABRIC_API static const Vector3f& getColor( const Type type );
95 };
96 
98 EQFABRIC_API std::ostream& operator << ( std::ostream&, const Statistic::Type&);
99 
101 EQFABRIC_API std::ostream& operator << ( std::ostream&, const Statistic& );
102 
103 }
104 }
105 
106 namespace lunchbox
107 {
108 template<> inline void byteswap( eq::fabric::Statistic::Type& value )
109 { byteswap( reinterpret_cast< uint32_t& >( value )); }
110 
111 template<> inline void byteswap( eq::fabric::Statistic& value )
112 {
113  byteswap( value.type );
114  byteswap( value.frameNumber );
115  byteswap( value.task );
116  byteswap( value.plugins[0] );
117  byteswap( value.plugins[1] );
118 
119  byteswap( value.startTime );
120  byteswap( value.endTime );
121  byteswap( value.idleTime );
122  byteswap( value.totalTime );
123 
124  byteswap( value.ratio );
125  byteswap( value.currentFPS );
126  byteswap( value.averageFPS );
127 }
128 }
129 
130 #endif // EQ_FABRIC_STATISTIC_H
Base event structure to report window system and other events.
Definition: event.h:36
Sampling of synchronization time during Config::finishFrame.
Definition: statistic.h:70
Sampling of Channel::frameReadback.
Definition: statistic.h:52
uint32_t plugins[2]
color,depth plugins (readback, compression)
Definition: statistic.h:77
Sampling of waiting for a send token from the receiver.
Definition: statistic.h:58
Defines export visibility macros for library EqualizerFabric.
Sampling of Channel::frameDrawFinish.
Definition: statistic.h:49
Sampling of Channel::frameClear.
Definition: statistic.h:47
Sampling of Channel::frameViewFinish.
Definition: statistic.h:54
Sampling of Config::startFrame.
Definition: statistic.h:67
Sampling of Window::finish before a swap barrier.
Definition: statistic.h:59
int64_t startTime
Absolute start time of the operation.
Definition: statistic.h:79
Sampling of Frame::waitReady.
Definition: statistic.h:51
static EQFABRIC_API const std::string & getName(const Type type)
Translate the Type to a string representation.
Sampling of frame compression.
Definition: statistic.h:56
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:44
uint32_t frameNumber
The frame during when the sampling happened.
Definition: statistic.h:75
Sampling of frame decompression.
Definition: statistic.h:66
float currentFPS
FPS of last frame (WINDOW_FPS)
Definition: statistic.h:85
Sampling of swap barrier block.
Definition: statistic.h:62
Type type
The type of statistic.
Definition: statistic.h:74
Sampling of Channel::frameDraw.
Definition: statistic.h:48
The Equalizer client library.
Definition: eq/agl/types.h:23
int64_t totalTime
Total time of a pipe frame (PIPE_IDLE)
Definition: statistic.h:82
char resourceName[32]
A non-unique name of the originator.
Definition: statistic.h:89
std::ostream & operator<<(std::ostream &os, const AxisEvent &event)
Print the axis event to the given output stream.
Definition: axisEvent.h:42
Sampling of Window::swapBuffers.
Definition: statistic.h:63
int64_t idleTime
Absolute idle time of PIPE_IDLE.
Definition: statistic.h:81
float ratio
compression ratio (transfer, compression)
Definition: statistic.h:84
Sampling of throttling of framerate_equalizer.
Definition: statistic.h:61
float averageFPS
Weighted sum averaging of FPS (WINDOW_FPS)
Definition: statistic.h:86
A statistics event.
Definition: statistic.h:41
int64_t endTime
Absolute end time of the operation.
Definition: statistic.h:80
Sampling of async readback.
Definition: statistic.h:53
Sampling of Config::finishFrame.
Definition: statistic.h:68
Sampling of Channel::frameAssemble.
Definition: statistic.h:50
Framerate sampling.
Definition: statistic.h:64
Sampling of frame transmission.
Definition: statistic.h:55
Pipe thread idle ratio.
Definition: statistic.h:65