11 #include "../eve-core/utils/misc.h"
21 sLog.Blue(
" Profile Manager",
"Profiling initialized.");
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);
65 m_map.push_back(value);
71 m_npc.push_back(value);
86 m_db.push_back(value);
143 sLog.Error(
"Profile::AddTime()",
"Default reached on key %u.", key );
185 float h(0.0f), l(0.0f), a(0.0f);
186 sLog.Green(
" Server Profile",
" Current Process Profile times for this run:");
188 std::printf(
"\t\tLoop Calls\n");
191 std::printf(
" EntityList %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
194 std::printf(
" Client %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
197 std::printf(
" SystemMgr %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
200 std::printf(
" Bubbles %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
203 std::printf(
" Destiny %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
206 std::printf(
" NPC %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
209 std::printf(
" Modules %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
212 std::printf(
" Ship %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
218 std::printf(
" TargetProc %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
221 std::printf(
" Missile %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
224 std::printf(
" Damage %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
228 std::printf(
" Spawns %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
230 std::printf(
" Spawns Disabled.\n");
232 if (
sConfig.cosmic.BumpEnabled) {
235 std::printf(
" Collisions %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
237 std::printf(
" Collisions Disabled.\n");
239 if (
sConfig.testing.EnableDrones) {
242 std::printf(
" Drones %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
244 std::printf(
" Drones Disabled.\n");
248 std::printf(
"\t\tPeriodic Calls\n");
251 std::printf(
" DB %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
254 std::printf(
" Parse Effects %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
257 std::printf(
" Apply Effects %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
260 std::printf(
" Item Loading %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
263 std::printf(
" Loot %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
266 std::printf(
" Salvage %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
267 if (
sConfig.cosmic.PIEnabled) {
270 std::printf(
" Colony %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
272 std::printf(
" Colony Disabled.\n");
276 std::printf(
" Concord %s times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
278 std::printf(
" Concord Disabled.\n");
282 std::printf(
"\t\tUnimplemented Calls\n");
284 std::printf(
" *Main() %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n",
m_server.size(), h, l, a );
286 std::printf(
" *Map %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n",
m_map.size(), h, l, a );
288 std::printf(
" *Items %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n",
m_items.size(), h, l, a );
290 std::printf(
" *Functions %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n",
m_functions.size(), h, l, a );
292 std::printf(
" Profile Times Compiled in %.4fus\n", (
GetTimeUSeconds() -startTime) );
299 float h(0.0f), l(0.0f), a(0.0f);
300 sLog.Green(
" Server Profile",
" Current Process Profile times for this run:");
304 std::printf(
" DB %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
307 std::printf(
" Item Loading %s times. \tHi: %.4fus \tLo: %.4fus \tAvg: %.4fus\n", fSize.c_str(), h, l, a );
309 std::printf(
"\t\tUnimplemented Calls\n");
311 std::printf(
" *Main() %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n",
m_server.size(), h, l, a );
313 std::printf(
" *Map %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n",
m_map.size(), h, l, a );
315 std::printf(
" *Items %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n",
m_items.size(), h, l, a );
317 std::printf(
" *Functions %u times. \tHi: %.4f \tLo: %.4fus \tAvg: %.4fus\n",
m_functions.size(), h, l, a );
319 std::printf(
" Profile Times Compiled in %.4fus\n", (
GetTimeUSeconds() -startTime) );
324 if (container.empty()) {
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);
348 if (cSize > 999999) {
349 fSize = std::to_string(cSize / 1000000);
351 }
else if (cSize > 9999) {
352 fSize = std::to_string(cSize / 1000);
355 fSize = std::to_string(cSize);
388 default:
return "Invalid Key";
std::vector< double > m_missile
#define sConfig
A macro for easier access to the singleton.
std::vector< double > m_ontarget
std::vector< double > m_loot
std::vector< double > m_spawn
std::vector< double > m_damage
std::vector< double > m_npc
std::vector< double > m_db
void AddTime(uint8 key, double value)
#define sLog
Evaluates to a NewLog instance.
std::vector< double > m_entityS
std::vector< double > m_drone
std::vector< double > m_items
void GetSize(size_t cSize, std::string &ret)
std::vector< double > m_salvage
std::vector< double > m_targets
std::vector< double > m_ship
std::string GetKeyName(uint8 &key)
std::vector< double > m_effects1
std::vector< double > m_colony
std::vector< double > m_concord
std::vector< double > m_functions
std::vector< double > m_itemload
std::vector< double > m_system
std::vector< double > m_client
std::vector< double > m_modules
std::vector< double > m_bubbles
std::vector< double > m_destiny
std::vector< double > m_effects2
void GetRunTimes(std::vector< double > &container, float &h, float &l, float &a)
std::vector< double > m_map
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
std::vector< double > m_server