3 #include <format/format.h> 4 #include "../../clib/fileutil.h" 5 #include "../../clib/logfacility.h" 6 #include "../../plib/systemstate.h" 16 #include "pol_global_config.h" 40 std::vector<std::pair<std::string, size_t>> logs;
42 logs.push_back( std::make_pair(
"CPProfilerSize", cprop_profiler_size ) );
43 logs.push_back( std::make_pair(
"GameStateSize", gamestate_size.misc ) );
44 logs.push_back( std::make_pair(
"RealmSize", gamestate_size.realm_size ) );
45 logs.push_back( std::make_pair(
"SystemStateSize", systemstate_size ) );
46 logs.push_back( std::make_pair(
"MultiBufferSize", multibuffer_size ) );
47 logs.push_back( std::make_pair(
"SettingsSize", settings_size ) );
48 logs.push_back( std::make_pair(
"StateSize", state_size ) );
49 logs.push_back( std::make_pair(
"ScriptCount", script_sizes.script_count ) );
50 logs.push_back( std::make_pair(
"ScriptSize", script_sizes.script_size ) );
51 logs.push_back( std::make_pair(
"ScriptStoreCount", script_sizes.scriptstorage_count ) );
52 logs.push_back( std::make_pair(
"ScriptStoreSize", script_sizes.scriptstorage_size ) );
53 logs.push_back( std::make_pair(
"ConfigCount", config_sizes.cfg_count ) );
54 logs.push_back( std::make_pair(
"ConfigSize", config_sizes.cfg_size ) );
55 logs.push_back( std::make_pair(
"DataStoreCount", config_sizes.datastore_count ) );
56 logs.push_back( std::make_pair(
"DataStoreSize", config_sizes.datastore_size ) );
57 logs.push_back( std::make_pair(
"ConfigBufferSize", config_sizes.misc ) );
58 logs.push_back( std::make_pair(
"AccountCount", gamestate_size.account_count ) );
59 logs.push_back( std::make_pair(
"AccountSize", gamestate_size.account_size ) );
60 logs.push_back( std::make_pair(
"ClientCount", network_size.client_count ) );
61 logs.push_back( std::make_pair(
"ClientSize", network_size.client_size ) );
62 logs.push_back( std::make_pair(
"NetworkSize", network_size.misc ) );
63 logs.push_back( std::make_pair(
"ObjectStorage", object_sizes.misc ) );
65 logs.push_back( std::make_pair(
"ObjItemCount", object_sizes.obj_item_count ) );
66 logs.push_back( std::make_pair(
"ObjItemSize", object_sizes.obj_item_size ) );
67 logs.push_back( std::make_pair(
"ObjContCount", object_sizes.obj_cont_count ) );
68 logs.push_back( std::make_pair(
"ObjContSize", object_sizes.obj_cont_size ) );
69 logs.push_back( std::make_pair(
"ObjCharCount", object_sizes.obj_char_count ) );
70 logs.push_back( std::make_pair(
"ObjCharSize", object_sizes.obj_char_size ) );
71 logs.push_back( std::make_pair(
"ObjNpcCount", object_sizes.obj_npc_count ) );
72 logs.push_back( std::make_pair(
"ObjNpcSize", object_sizes.obj_npc_size ) );
73 logs.push_back( std::make_pair(
"ObjWeaponCount", object_sizes.obj_weapon_count ) );
74 logs.push_back( std::make_pair(
"ObjWeaponSize", object_sizes.obj_weapon_size ) );
75 logs.push_back( std::make_pair(
"ObjArmorCount", object_sizes.obj_armor_count ) );
76 logs.push_back( std::make_pair(
"ObjArmorSize", object_sizes.obj_armor_size ) );
77 logs.push_back( std::make_pair(
"ObjMultiCount", object_sizes.obj_multi_count ) );
78 logs.push_back( std::make_pair(
"ObjMultiSize", object_sizes.obj_multi_size ) );
80 #ifdef DEBUG_FLYWEIGHT 81 for (
size_t i = 0; i < boost_utils::debug_flyweight_queries.size(); ++i )
83 auto ptr = boost_utils::debug_flyweight_queries[i];
86 auto str = std::to_string( i );
87 logs.push_back( std::make_pair(
"FlyWeightBucket" + str +
"Count", ptr->bucket_count() ) );
88 logs.push_back( std::make_pair(
"FlyWeightBucket" + str +
"Size", ptr->estimateSize() ) );
97 for (
const auto& entry : logs )
98 header <<
" ;" << entry.first;
105 for (
const auto& entry : logs )
106 line <<
" ;" << entry.second;
size_t getCurrentMemoryUsage()
returns the current process size in bytes
size_t estimateSize() const
Memory estimateSize() const
static CPropProfiler & instance()
Memory estimateSize() const
MemoryUsage estimateSize() const
size_t estimatedSize() const
Memory estimateSize() const
Memory estimateSize() const
size_t estimateSize() const
NetworkManager networkManager
#define GET_LOG_FILESTAMP
ConfigurationBuffer configurationbuffer
#define OPEN_FLEXLOG(filename, open_timestamp)
size_t estimateSize() const
size_t estimateSize() const
SettingsManager settingsManager
StateManager stateManager
ScriptScheduler scriptScheduler
ObjectStorageManager objStorageManager
bool FileExists(const char *filename)
MultiDefBuffer multidef_buffer
#define CLOSE_FLEXLOG(id)