VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtInMemoryProfiler.h
Go to the documentation of this file.
1 /*********************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvUtil/vrvUtil.h>
13 
14 #include <string>
15 #include <deque>
16 
17 class DtTimedSection;
18 
19 namespace makVrv
20 {
21  class DtSampleAggregator;
22 
26  {
27  public:
30  static std::size_t calculateNumberOfSamples(float estimatedFrequency, float estimatedRunTimeSeconds);
31 
36 
39 
40  void init(std::size_t numOfSamples, const std::string& fileName);
41 
43  std::size_t numSamples() const;
44 
46  void start();
47 
49  void stop();
50 
52  void reset();
53 
56  bool dumped() const;
57 
58  // dump stats and force a dump of the underlying data; called if stopping and not dumped()
59  void dump();
60 
63  bool valid() const;
64 
65  protected:
66 
68  void dumpStats();
69 
70  DtTimedSection* myTimer;
72  bool myStarted;
73  };
74 
76  {
77  public:
78  DtInMemoryProfilerHelper(std::size_t numOfSamples, const std::string& fileName);
79 
80  void addProfile(double fStart, double fEndAt);
81  void clearProfiles(void);
82 
83  void profilerPre(double elapsedTime);
84  void profilerPost();
85  private:
87 
88  struct ProfileData
89  {
91  : myStartAt(0), myEndAt(0), myLoggedStart(false), myDumped(false), myID(0) {}
92  double myStartAt;
93  double myEndAt;
95  bool myDumped;
96  std::size_t myID;
97  };
98 
99  typedef std::deque<ProfileData> Profiles;
101 
103  };
104 }
105 
double myEndAt
Definition: DtInMemoryProfiler.h:93
bool myDumped
Definition: DtInMemoryProfiler.h:95
#define DT_DLL_VRVUTIL
Definition: vrvUtil.h:34
The DtSampleAggregator allows users to collect up to a fixed number of rows of N columns of doubles...
Definition: DtSampleAggregator.h:24
double myStartAt
Definition: DtInMemoryProfiler.h:92
bool myLoggedStart
Definition: DtInMemoryProfiler.h:94
bool myStarted
Definition: DtInMemoryProfiler.h:72
Contains DLL export macros.
This class measures time difference (cpu time, wall time, etc) between calls to its start and stop fu...
Definition: DtInMemoryProfiler.h:25
DtSampleAggregator * myAggregator
Definition: DtInMemoryProfiler.h:71
DtInMemoryProfiler myProfiler
Definition: DtInMemoryProfiler.h:86
ProfileData()
Definition: DtInMemoryProfiler.h:90
std::size_t myID
Definition: DtInMemoryProfiler.h:96
Definition: DtInMemoryProfiler.h:75
Profiles myProfiles
Definition: DtInMemoryProfiler.h:100
bool myIsProfiling
Definition: DtInMemoryProfiler.h:102
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtTimedSection * myTimer
Definition: DtInMemoryProfiler.h:70
std::deque< ProfileData > Profiles
Definition: DtInMemoryProfiler.h:99
Definition: DtInMemoryProfiler.h:88

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)