More work on PerformanceHelper

Getting first version to run and produce output
This commit is contained in:
Alexander Bock
2016-06-06 07:00:36 +02:00
parent ff0b916b90
commit 55bd1341e6
6 changed files with 203 additions and 124 deletions
@@ -36,9 +36,7 @@ struct PerformanceLayout {
static const int NumberValues = 256;
static const int MaxValues = 256;
PerformanceLayout(int32_t nEntries);
int32_t nEntries;
PerformanceLayout();
struct SceneGraphPerformanceLayout {
char name[LengthName];
@@ -51,6 +49,7 @@ struct PerformanceLayout {
int32_t currentUpdateEphemeris;
};
SceneGraphPerformanceLayout sceneGraphEntries[MaxValues];
int16_t nScaleGraphEntries;
struct FunctionPerformanceLayout {
char name[LengthName];
@@ -58,6 +57,7 @@ struct PerformanceLayout {
int32_t currentTime;
};
FunctionPerformanceLayout functionEntries[MaxValues];
int16_t nFunctionEntries;
};
} // namespace performance
@@ -26,6 +26,7 @@
#define __PERFORMANCEMANAGER_H__
#include <chrono>
#include <map>
#include <vector>
namespace ghoul {
@@ -45,13 +46,18 @@ public:
PerformanceManager();
~PerformanceManager();
void resetPerformanceMeasurements();
bool isMeasuringPerformance() const;
void storeIndividualPerformanceMeasurement(std::string identifier, long long us);
void storeIndividualPerformanceMeasurement(std::string identifier, long long nanoseconds);
void storeScenePerformanceMeasurements(const std::vector<SceneGraphNode*>& sceneNodes);
private:
bool _doPerformanceMeasurements;
std::map<std::string, size_t> individualPerformanceLocations;
ghoul::SharedMemory* _performanceMemory;
};