EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Profiler Class Reference

#include "Profiler.h"

Inheritance diagram for Profiler:
Collaboration diagram for Profiler:

Public Member Functions

void AddTime (uint8 key, double value)
 
- Public Member Functions inherited from Singleton< Profiler >
 Singleton ()
 Primary constructor. More...
 

Private Attributes

std::vector< double > m_server
 
std::vector< double > m_functions
 
std::vector< double > m_db
 
std::vector< double > m_client
 
std::vector< double > m_map
 
std::vector< double > m_destiny
 
std::vector< double > m_system
 
std::vector< double > m_entityS
 
std::vector< double > m_npc
 
std::vector< double > m_drone
 
std::vector< double > m_bubbles
 
std::vector< double > m_items
 
std::vector< double > m_itemload
 
std::vector< double > m_modules
 
std::vector< double > m_ship
 
std::vector< double > m_targets
 
std::vector< double > m_ontarget
 
std::vector< double > m_missile
 
std::vector< double > m_loot
 
std::vector< double > m_salvage
 
std::vector< double > m_spawn
 
std::vector< double > m_collision
 
std::vector< double > m_concord
 
std::vector< double > m_colony
 
std::vector< double > m_damage
 
std::vector< double > m_effects1
 
std::vector< double > m_effects2
 

Profiler.cpp

lightweight profiling code specifically for timing sections of running EvEmu application this code is very basic, and very specific. : Allan

Date
: 13 April 2015
void AddTime (uint8 key, double value)
 
 Profiler ()
 
 ~Profiler ()
 
int Initialize ()
 
void PrintProfile ()
 
void PrintStartUpData ()
 
void ClearAll ()
 
void GetSize (size_t cSize, std::string &ret)
 
void GetRunTimes (std::vector< double > &container, float &h, float &l, float &a)
 
std::string GetKeyName (uint8 &key)
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< Profiler >
static Profilerget ()
 
- Static Protected Attributes inherited from Singleton< Profiler >
static std::shared_ptr< ProfilermInstance
 

Detailed Description

Definition at line 41 of file dbcore.cpp.

Constructor & Destructor Documentation

Profiler::Profiler ( )

Definition at line 13 of file Profiler.cpp.

13 { }
Profiler::~Profiler ( )

Definition at line 15 of file Profiler.cpp.

15  {
16  //ClearAll();
17 }

Member Function Documentation

void Profiler::AddTime ( uint8  key,
double  value 
)

Definition at line 25 of file Profiler.cpp.

References GetKeyName(), m_bubbles, m_client, m_collision, m_colony, m_concord, m_damage, m_db, m_destiny, m_drone, m_effects1, m_effects2, m_entityS, m_functions, m_itemload, m_items, m_loot, m_map, m_missile, m_modules, m_npc, m_ontarget, m_salvage, m_server, m_ship, m_spawn, m_system, m_targets, sConfig, and sLog.

25  {
26  if (sConfig.debug.ProfileTraceTime > 0)
27  if (value > sConfig.debug.ProfileTraceTime *1000) {
28  sLog.Warning(" Profile Manager", "Long Profile Time on key %s, time %.3f.", GetKeyName(key).c_str(), value);
29  //EvE::traceStack();
30  }
31  /*
32  Profile::destiny = 1, *
33  Profile::map = 2,
34  Profile::client = 3, *
35  Profile::npc = 4, *
36  Profile::bubbles = 5, *
37  Profile::items = 6,
38  Profile::modules = 7, *
39  Profile::functions = 8,
40  Profile::db = 9, *
41  Profile::ship = 10, *
42  Profile::targets = 11,
43  Profile::server = 12,
44  Profile::missile = 13,
45  Profile::system = 14,
46  Profile::entityS = 15, *
47  Profile::loot = 16, *
48  Profile::salvage = 17,
49  Profile::spawn = 18, *
50  Profile::collision = 19, *
51  Profile::drone = 20, *
52  Profile::itemload = 21, *
53  Profile::concord = 22, *
54  Profile::colony = 23, *
55  Profile::damage = 24, *
56  Profile::parseFX = 25, *
57  Profile::applyFX = 26, *
58  Profile::onTarg = 27
59  */
60  switch(key) {
61  case 1:
62  m_destiny.push_back(value);
63  break;
64  case 2:
65  m_map.push_back(value);
66  break;
67  case 3:
68  m_client.push_back(value);
69  break;
70  case 4:
71  m_npc.push_back(value);
72  break;
73  case 5:
74  m_bubbles.push_back(value);
75  break;
76  case 6:
77  m_items.push_back(value);
78  break;
79  case 7:
80  m_modules.push_back(value);
81  break;
82  case 8:
83  m_functions.push_back(value);
84  break;
85  case 9:
86  m_db.push_back(value);
87  break;
88  case 10:
89  m_ship.push_back(value);
90  break;
91  case 11:
92  m_targets.push_back(value);
93  break;
94  case 12:
95  m_server.push_back(value);
96  break;
97  case 13:
98  m_missile.push_back(value);
99  break;
100  case 14:
101  m_system.push_back(value);
102  break;
103  case 15:
104  m_entityS.push_back(value);
105  break;
106  case 16:
107  m_loot.push_back(value);
108  break;
109  case 17:
110  m_salvage.push_back(value);
111  break;
112  case 18:
113  m_spawn.push_back(value);
114  break;
115  case 19:
116  m_collision.push_back(value);
117  break;
118  case 20:
119  m_drone.push_back(value);
120  break;
121  case 21:
122  m_itemload.push_back(value);
123  break;
124  case 22:
125  m_concord.push_back(value);
126  break;
127  case 23:
128  m_colony.push_back(value);
129  break;
130  case 24:
131  m_damage.push_back(value);
132  break;
133  case 25:
134  m_effects1.push_back(value);
135  break;
136  case 26:
137  m_effects2.push_back(value);
138  break;
139  case 27:
140  m_ontarget.push_back(value);
141  break;
142  default:
143  sLog.Error("Profile::AddTime()", "Default reached on key %u.", key );
144  break;
145  }
146 }
std::vector< double > m_missile
Definition: Profiler.h:97
#define sConfig
A macro for easier access to the singleton.
std::vector< double > m_ontarget
Definition: Profiler.h:96
std::vector< double > m_loot
Definition: Profiler.h:98
std::vector< double > m_spawn
Definition: Profiler.h:100
std::vector< double > m_damage
Definition: Profiler.h:104
std::vector< double > m_npc
Definition: Profiler.h:88
std::vector< double > m_db
Definition: Profiler.h:82
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
std::vector< double > m_entityS
Definition: Profiler.h:87
std::vector< double > m_drone
Definition: Profiler.h:89
std::vector< double > m_items
Definition: Profiler.h:91
std::vector< double > m_salvage
Definition: Profiler.h:99
std::vector< double > m_targets
Definition: Profiler.h:95
std::vector< double > m_ship
Definition: Profiler.h:94
std::string GetKeyName(uint8 &key)
Definition: Profiler.cpp:359
std::vector< double > m_effects1
Definition: Profiler.h:105
std::vector< double > m_colony
Definition: Profiler.h:103
std::vector< double > m_concord
Definition: Profiler.h:102
std::vector< double > m_functions
Definition: Profiler.h:81
std::vector< double > m_itemload
Definition: Profiler.h:92
std::vector< double > m_system
Definition: Profiler.h:86
std::vector< double > m_client
Definition: Profiler.h:83
std::vector< double > m_modules
Definition: Profiler.h:93
std::vector< double > m_bubbles
Definition: Profiler.h:90
std::vector< double > m_destiny
Definition: Profiler.h:85
std::vector< double > m_effects2
Definition: Profiler.h:106
std::vector< double > m_map
Definition: Profiler.h:84
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type() key(value)-Send an OnRemoteMessage" ) COMMAND( setbpattr
std::vector< double > m_collision
Definition: Profiler.h:101
std::vector< double > m_server
Definition: Profiler.h:80

Here is the call graph for this function:

void Profiler::AddTime ( uint8  key,
double  value 
)
void Profiler::ClearAll ( )

Definition at line 148 of file Profiler.cpp.

References m_bubbles, m_client, m_collision, m_colony, m_concord, m_damage, m_db, m_destiny, m_drone, m_effects1, m_effects2, m_entityS, m_functions, m_itemload, m_items, m_loot, m_map, m_missile, m_modules, m_npc, m_ontarget, m_salvage, m_server, m_ship, m_spawn, m_system, and m_targets.

Referenced by Initialize().

149 {
150  m_server.clear();
151  m_destiny.clear();
152  m_map.clear();
153  m_client.clear();
154  m_npc.clear();
155  m_bubbles.clear();
156  m_items.clear();
157  m_modules.clear();
158  m_functions.clear();
159  m_db.clear();
160  m_ship.clear();
161  m_targets.clear();
162  m_ontarget.clear();
163  m_missile.clear();
164  m_system.clear();
165  m_entityS.clear();
166  m_loot.clear();
167  m_salvage.clear();
168  m_spawn.clear();
169  m_collision.clear();
170  m_drone.clear();
171  m_itemload.clear();
172  m_concord.clear();
173  m_colony.clear();
174  m_damage.clear();
175  m_effects1.clear();
176  m_effects2.clear();
177 }
std::vector< double > m_missile
Definition: Profiler.h:97
std::vector< double > m_ontarget
Definition: Profiler.h:96
std::vector< double > m_loot
Definition: Profiler.h:98
std::vector< double > m_spawn
Definition: Profiler.h:100
std::vector< double > m_damage
Definition: Profiler.h:104
std::vector< double > m_npc
Definition: Profiler.h:88
std::vector< double > m_db
Definition: Profiler.h:82
std::vector< double > m_entityS
Definition: Profiler.h:87
std::vector< double > m_drone
Definition: Profiler.h:89
std::vector< double > m_items
Definition: Profiler.h:91
std::vector< double > m_salvage
Definition: Profiler.h:99
std::vector< double > m_targets
Definition: Profiler.h:95
std::vector< double > m_ship
Definition: Profiler.h:94
std::vector< double > m_effects1
Definition: Profiler.h:105
std::vector< double > m_colony
Definition: Profiler.h:103
std::vector< double > m_concord
Definition: Profiler.h:102
std::vector< double > m_functions
Definition: Profiler.h:81
std::vector< double > m_itemload
Definition: Profiler.h:92
std::vector< double > m_system
Definition: Profiler.h:86
std::vector< double > m_client
Definition: Profiler.h:83
std::vector< double > m_modules
Definition: Profiler.h:93
std::vector< double > m_bubbles
Definition: Profiler.h:90
std::vector< double > m_destiny
Definition: Profiler.h:85
std::vector< double > m_effects2
Definition: Profiler.h:106
std::vector< double > m_map
Definition: Profiler.h:84
std::vector< double > m_collision
Definition: Profiler.h:101
std::vector< double > m_server
Definition: Profiler.h:80

Here is the caller graph for this function:

std::string Profiler::GetKeyName ( uint8 key)
protected

Definition at line 359 of file Profiler.cpp.

References Profile::applyFX, Profile::bubbles, Profile::client, Profile::collision, Profile::colony, Profile::concord, Profile::damage, Profile::db, Profile::destiny, Profile::drone, Profile::entityS, Profile::functions, Profile::itemload, Profile::items, Profile::loot, Profile::map, Profile::missile, Profile::modules, Profile::npc, Profile::parseFX, Profile::salvage, Profile::server, Profile::ship, Profile::spawn, Profile::system, and Profile::targets.

Referenced by AddTime().

360 {
361  switch (key) {
362  case Profile::destiny: return "Destiny"; // 1,
363  case Profile::map: return "Map"; // 2,
364  case Profile::client: return "Client"; // 3,
365  case Profile::npc: return "NPC"; // 4,
366  case Profile::bubbles: return "Bubble"; // 5,
367  case Profile::items: return "Item"; // 6,
368  case Profile::modules: return "Module"; // 7,
369  case Profile::functions: return "Function"; // 8,
370  case Profile::db: return "DB"; // 9,
371  case Profile::ship: return "Ship"; // 10,
372  case Profile::targets: return "Target"; // 11,
373  case Profile::server: return "Server"; // 12,
374  case Profile::missile: return "Missile"; // 13,
375  case Profile::system: return "System"; // 14,
376  case Profile::entityS: return "EntityTic"; // 15,
377  case Profile::loot: return "Loot"; // 16,
378  case Profile::salvage: return "Salvage"; // 17,
379  case Profile::spawn: return "Spawn"; // 18,
380  case Profile::collision: return "Collision"; // 19,
381  case Profile::drone: return "Drone"; // 20,
382  case Profile::itemload: return "ItemLoad"; // 21,
383  case Profile::concord: return "Concord"; // 22,
384  case Profile::colony: return "Colony"; // 23,
385  case Profile::damage: return "Damage"; // 24,
386  case Profile::parseFX: return "ParseFX"; // 25,
387  case Profile::applyFX: return "ApplyFX"; // 26
388  default: return "Invalid Key";
389  }
390 }
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type() key(value)-Send an OnRemoteMessage" ) COMMAND( setbpattr

Here is the caller graph for this function:

void Profiler::GetRunTimes ( std::vector< double > &  container,
float &  h,
float &  l,
float &  a 
)

Definition at line 322 of file Profiler.cpp.

Referenced by PrintProfile(), and PrintStartUpData().

323 {
324  if (container.empty()) {
325  h = 0.0f;
326  l = 0.0f;
327  a = 0.0f;
328  return;
329  }
330 
331  uint32 size = container.size();
332  float total(0.0f), lo(0.0f), hi(0.0f);
333  for (uint32 i = 0; i < size; ++i) {
334  total += container.at(i);
335  if ((lo > container.at(i)) or (lo < 0.000001f))
336  lo = container.at(i);
337  if (hi < container.at(i))
338  hi = container.at(i);
339  }
340 
341  h = hi;
342  l = lo;
343  a = total / size;
344 }
unsigned __int32 uint32
Definition: eve-compat.h:50

Here is the caller graph for this function:

void Profiler::GetSize ( size_t  cSize,
std::string &  ret 
)

Definition at line 346 of file Profiler.cpp.

Referenced by PrintProfile(), and PrintStartUpData().

347 {
348  if (cSize > 999999) {
349  fSize = std::to_string(cSize / 1000000);
350  fSize += "m";
351  } else if (cSize > 9999) {
352  fSize = std::to_string(cSize / 1000);
353  fSize += "k";
354  } else {
355  fSize = std::to_string(cSize);
356  }
357 }

Here is the caller graph for this function:

int Profiler::Initialize ( )

Definition at line 19 of file Profiler.cpp.

References ClearAll(), and sLog.

19  {
20  ClearAll();
21  sLog.Blue(" Profile Manager", "Profiling initialized.");
22  return 1;
23 }
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
void ClearAll()
Definition: Profiler.cpp:148

Here is the call graph for this function:

void Profiler::PrintProfile ( )
Todo:
figure out how to color this based on times....R,Y,G,M,B,W

Definition at line 179 of file Profiler.cpp.

References GetRunTimes(), GetSize(), GetTimeUSeconds(), m_bubbles, m_client, m_collision, m_colony, m_concord, m_damage, m_db, m_destiny, m_drone, m_effects1, m_effects2, m_entityS, m_functions, m_itemload, m_items, m_loot, m_map, m_missile, m_modules, m_npc, m_salvage, m_server, m_ship, m_spawn, m_system, m_targets, sConfig, and sLog.

180 {
183  double startTime = GetTimeUSeconds();
184  std::string fSize;
185  float h(0.0f), l(0.0f), a(0.0f);
186  sLog.Green(" Server Profile", " Current Process Profile times for this run:");
187  //std::printf("\n"); // spacer
188  std::printf("\t\tLoop Calls\n");
189  GetRunTimes(m_entityS, h, l, a);
190  GetSize(m_entityS.size(), fSize);
191  std::printf(" EntityList %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
192  GetRunTimes(m_client, h, l, a);
193  GetSize(m_client.size(), fSize);
194  std::printf(" Client %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
195  GetRunTimes(m_system, h, l, a);
196  GetSize(m_system.size(), fSize);
197  std::printf(" SystemMgr %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
198  GetRunTimes(m_bubbles, h, l, a);
199  GetSize(m_bubbles.size(), fSize);
200  std::printf(" Bubbles %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
201  GetRunTimes(m_destiny, h, l, a);
202  GetSize(m_destiny.size(), fSize);
203  std::printf(" Destiny %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
204  GetRunTimes(m_npc, h, l, a);
205  GetSize(m_npc.size(), fSize);
206  std::printf(" NPC %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
207  GetRunTimes(m_modules, h, l, a);
208  GetSize(m_modules.size(), fSize);
209  std::printf(" Modules %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
210  GetRunTimes(m_ship, h, l, a);
211  GetSize(m_ship.size(), fSize);
212  std::printf(" Ship %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
213  //GetRunTimes(m_ontarget, h, l, a);
214  //GetSize(m_ontarget.size(), fSize);
215  //std::printf(" OnTarget %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
216  GetRunTimes(m_targets, h, l, a);
217  GetSize(m_targets.size(), fSize);
218  std::printf(" TargetProc %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
219  GetRunTimes(m_missile, h, l, a);
220  GetSize(m_missile.size(), fSize);
221  std::printf(" Missile %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
222  GetRunTimes(m_damage, h, l, a);
223  GetSize(m_damage.size(), fSize);
224  std::printf(" Damage %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
225  if (sConfig.npc.RoamingSpawns or sConfig.npc.StaticSpawns) {
226  GetRunTimes(m_spawn, h, l, a);
227  GetSize(m_spawn.size(), fSize);
228  std::printf(" Spawns %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
229  } else {
230  std::printf(" Spawns Disabled.\n");
231  }
232  if (sConfig.cosmic.BumpEnabled) {
233  GetRunTimes(m_collision, h, l, a);
234  GetSize(m_collision.size(), fSize);
235  std::printf(" Collisions %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
236  } else {
237  std::printf(" Collisions Disabled.\n");
238  }
239  if (sConfig.testing.EnableDrones) {
240  GetRunTimes(m_drone, h, l, a);
241  GetSize(m_drone.size(), fSize);
242  std::printf(" Drones %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
243  } else {
244  std::printf(" Drones Disabled.\n");
245  }
246 
247  //std::printf("\n"); // spacer
248  std::printf("\t\tPeriodic Calls\n");
249  GetRunTimes(m_db, h, l, a);
250  GetSize(m_db.size(), fSize);
251  std::printf(" DB %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
252  GetRunTimes(m_effects1, h, l, a);
253  GetSize(m_effects1.size(), fSize);
254  std::printf(" Parse Effects %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
255  GetRunTimes(m_effects2, h, l, a);
256  GetSize(m_effects2.size(), fSize);
257  std::printf(" Apply Effects %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
258  GetRunTimes(m_itemload, h, l, a);
259  GetSize(m_itemload.size(), fSize);
260  std::printf(" Item Loading %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
261  GetRunTimes(m_loot, h, l, a);
262  GetSize(m_loot.size(), fSize);
263  std::printf(" Loot %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
264  GetRunTimes(m_salvage, h, l, a);
265  GetSize(m_salvage.size(), fSize);
266  std::printf(" Salvage %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
267  if (sConfig.cosmic.PIEnabled) {
268  GetRunTimes(m_colony, h, l, a);
269  GetSize(m_colony.size(), fSize);
270  std::printf(" Colony %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
271  } else {
272  std::printf(" Colony Disabled.\n");
273  }
274  if (sConfig.crime.Enabled) {
275  GetRunTimes(m_concord, h, l, a);GetSize(m_concord.size(), fSize);
276  std::printf(" Concord %s times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
277  } else {
278  std::printf(" Concord Disabled.\n");
279  }
280 
281  //std::printf("\n"); // spacer
282  std::printf("\t\tUnimplemented Calls\n");
283  GetRunTimes(m_server, h, l, a);
284  std::printf(" *Main() %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n", m_server.size(), h, l, a );
285  GetRunTimes(m_map, h, l, a);
286  std::printf(" *Map %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n", m_map.size(), h, l, a );
287  GetRunTimes(m_items, h, l, a);
288  std::printf(" *Items %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n", m_items.size(), h, l, a );
289  GetRunTimes(m_functions, h, l, a);
290  std::printf(" *Functions %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n", m_functions.size(), h, l, a );
291 
292  std::printf(" Profile Times Compiled in %.4fus\n", (GetTimeUSeconds() -startTime) );
293 }
std::vector< double > m_missile
Definition: Profiler.h:97
#define sConfig
A macro for easier access to the singleton.
std::vector< double > m_loot
Definition: Profiler.h:98
std::vector< double > m_spawn
Definition: Profiler.h:100
std::vector< double > m_damage
Definition: Profiler.h:104
std::vector< double > m_npc
Definition: Profiler.h:88
std::vector< double > m_db
Definition: Profiler.h:82
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
std::vector< double > m_entityS
Definition: Profiler.h:87
double GetTimeUSeconds()
Definition: utils_time.cpp:116
std::vector< double > m_drone
Definition: Profiler.h:89
std::vector< double > m_items
Definition: Profiler.h:91
void GetSize(size_t cSize, std::string &ret)
Definition: Profiler.cpp:346
std::vector< double > m_salvage
Definition: Profiler.h:99
std::vector< double > m_targets
Definition: Profiler.h:95
std::vector< double > m_ship
Definition: Profiler.h:94
std::vector< double > m_effects1
Definition: Profiler.h:105
std::vector< double > m_colony
Definition: Profiler.h:103
std::vector< double > m_concord
Definition: Profiler.h:102
std::vector< double > m_functions
Definition: Profiler.h:81
std::vector< double > m_itemload
Definition: Profiler.h:92
std::vector< double > m_system
Definition: Profiler.h:86
std::vector< double > m_client
Definition: Profiler.h:83
std::vector< double > m_modules
Definition: Profiler.h:93
std::vector< double > m_bubbles
Definition: Profiler.h:90
std::vector< double > m_destiny
Definition: Profiler.h:85
std::vector< double > m_effects2
Definition: Profiler.h:106
void GetRunTimes(std::vector< double > &container, float &h, float &l, float &a)
Definition: Profiler.cpp:322
std::vector< double > m_map
Definition: Profiler.h:84
std::vector< double > m_collision
Definition: Profiler.h:101
std::vector< double > m_server
Definition: Profiler.h:80

Here is the call graph for this function:

void Profiler::PrintStartUpData ( )

Definition at line 295 of file Profiler.cpp.

References GetRunTimes(), GetSize(), GetTimeUSeconds(), m_db, m_functions, m_itemload, m_items, m_map, m_server, and sLog.

296 {
297  double startTime = GetTimeUSeconds();
298  std::string fSize;
299  float h(0.0f), l(0.0f), a(0.0f);
300  sLog.Green(" Server Profile", " Current Process Profile times for this run:");
301 
302  GetRunTimes(m_db, h, l, a);
303  GetSize(m_db.size(), fSize);
304  std::printf(" DB %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
305  GetRunTimes(m_itemload, h, l, a);
306  GetSize(m_itemload.size(), fSize);
307  std::printf(" Item Loading %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
308  std::printf("\n"); // spacer
309  std::printf("\t\tUnimplemented Calls\n");
310  GetRunTimes(m_server, h, l, a);
311  std::printf(" *Main() %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n", m_server.size(), h, l, a );
312  GetRunTimes(m_map, h, l, a);
313  std::printf(" *Map %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n", m_map.size(), h, l, a );
314  GetRunTimes(m_items, h, l, a);
315  std::printf(" *Items %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n", m_items.size(), h, l, a );
316  GetRunTimes(m_functions, h, l, a);
317  std::printf(" *Functions %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n", m_functions.size(), h, l, a );
318 
319  std::printf(" Profile Times Compiled in %.4fus\n", (GetTimeUSeconds() -startTime) );
320 }
std::vector< double > m_db
Definition: Profiler.h:82
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
double GetTimeUSeconds()
Definition: utils_time.cpp:116
std::vector< double > m_items
Definition: Profiler.h:91
void GetSize(size_t cSize, std::string &ret)
Definition: Profiler.cpp:346
std::vector< double > m_functions
Definition: Profiler.h:81
std::vector< double > m_itemload
Definition: Profiler.h:92
void GetRunTimes(std::vector< double > &container, float &h, float &l, float &a)
Definition: Profiler.cpp:322
std::vector< double > m_map
Definition: Profiler.h:84
std::vector< double > m_server
Definition: Profiler.h:80

Here is the call graph for this function:

Member Data Documentation

std::vector<double> Profiler::m_bubbles
private

Definition at line 90 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_client
private

Definition at line 83 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_collision
private

Definition at line 101 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_colony
private

Definition at line 103 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_concord
private

Definition at line 102 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_damage
private

Definition at line 104 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_db
private

Definition at line 82 of file Profiler.h.

Referenced by AddTime(), ClearAll(), PrintProfile(), and PrintStartUpData().

std::vector<double> Profiler::m_destiny
private

Definition at line 85 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_drone
private

Definition at line 89 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_effects1
private

Definition at line 105 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_effects2
private

Definition at line 106 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_entityS
private

Definition at line 87 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_functions
private

Definition at line 81 of file Profiler.h.

Referenced by AddTime(), ClearAll(), PrintProfile(), and PrintStartUpData().

std::vector<double> Profiler::m_itemload
private

Definition at line 92 of file Profiler.h.

Referenced by AddTime(), ClearAll(), PrintProfile(), and PrintStartUpData().

std::vector<double> Profiler::m_items
private

Definition at line 91 of file Profiler.h.

Referenced by AddTime(), ClearAll(), PrintProfile(), and PrintStartUpData().

std::vector<double> Profiler::m_loot
private

Definition at line 98 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_map
private

Definition at line 84 of file Profiler.h.

Referenced by AddTime(), ClearAll(), PrintProfile(), and PrintStartUpData().

std::vector<double> Profiler::m_missile
private

Definition at line 97 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_modules
private

Definition at line 93 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_npc
private

Definition at line 88 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_ontarget
private

Definition at line 96 of file Profiler.h.

Referenced by AddTime(), and ClearAll().

std::vector<double> Profiler::m_salvage
private

Definition at line 99 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_server
private

Definition at line 80 of file Profiler.h.

Referenced by AddTime(), ClearAll(), PrintProfile(), and PrintStartUpData().

std::vector<double> Profiler::m_ship
private

Definition at line 94 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_spawn
private

Definition at line 100 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_system
private

Definition at line 86 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().

std::vector<double> Profiler::m_targets
private

Definition at line 95 of file Profiler.h.

Referenced by AddTime(), ClearAll(), and PrintProfile().


The documentation for this class was generated from the following files: