Update memory manager json

This commit is contained in:
Andrea Cavalli 2024-03-20 23:26:18 +01:00
parent 33131b65c3
commit 69bb2b9b9e
108 changed files with 959 additions and 385 deletions

View File

@ -1344,4 +1344,7 @@ void AccountManager::get_current_state(vector<td_api::object_ptr<td_api::Update>
}
}
void AccountManager::memory_stats(vector<string> &output) {
}
} // namespace td

View File

@ -21,6 +21,7 @@ class Td;
class AccountManager final : public Actor {
public:
void memory_stats(vector<string> &output);
AccountManager(Td *td, ActorShared<> parent);
AccountManager(const AccountManager &) = delete;
AccountManager &operator=(const AccountManager &) = delete;

View File

@ -888,11 +888,15 @@ void AnimationsManager::get_current_state(vector<td_api::object_ptr<td_api::Upda
}
void AnimationsManager::memory_stats(vector<string> &output) {
output.push_back("\"animations_\":"); output.push_back(std::to_string(animations_.calc_size()));
output.push_back(",");
output.push_back("\"saved_animation_ids_\":"); output.push_back(std::to_string(this->saved_animation_ids_.size()));
output.push_back(",");
output.push_back("\"saved_animation_file_ids_\":"); output.push_back(std::to_string(this->saved_animation_file_ids_.size()));
output.emplace_back("\"animations_\":"); output.emplace_back(std::to_string(this->animations_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"saved_animation_ids_\":"); output.emplace_back(std::to_string(this->saved_animation_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"saved_animation_file_ids_\":"); output.emplace_back(std::to_string(this->saved_animation_file_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"load_saved_animations_queries_\":"); output.emplace_back(std::to_string(this->load_saved_animations_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"repair_saved_animations_queries_\":"); output.emplace_back(std::to_string(this->repair_saved_animations_queries_.size()));
}
} // namespace td

View File

@ -28,6 +28,7 @@ class Td;
class AnimationsManager final : public Actor {
public:
void memory_stats(vector<string> &output);
AnimationsManager(Td *td, ActorShared<> parent);
AnimationsManager(const AnimationsManager &) = delete;
AnimationsManager &operator=(const AnimationsManager &) = delete;
@ -35,8 +36,6 @@ class AnimationsManager final : public Actor {
AnimationsManager &operator=(AnimationsManager &&) = delete;
~AnimationsManager() final;
void memory_stats(vector<string> &output);
int32 get_animation_duration(FileId file_id) const;
tl_object_ptr<td_api::animation> get_animation_object(FileId file_id) const;

View File

@ -1354,4 +1354,16 @@ void AttachMenuManager::get_current_state(vector<td_api::object_ptr<td_api::Upda
updates.push_back(get_update_attachment_menu_bots_object());
}
void AttachMenuManager::memory_stats(vector<string> &output) {
output.emplace_back("\"attach_menu_bots_\":"); output.emplace_back(std::to_string(this->attach_menu_bots_.size()));
output.emplace_back(",");
output.emplace_back("\"attach_menu_bot_file_source_ids_\":"); output.emplace_back(std::to_string(this->attach_menu_bot_file_source_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"reload_attach_menu_bots_queries_\":"); output.emplace_back(std::to_string(this->reload_attach_menu_bots_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"web_app_file_source_ids_\":"); output.emplace_back(std::to_string(this->web_app_file_source_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"opened_web_views_\":"); output.emplace_back(std::to_string(this->opened_web_views_.size()));
}
} // namespace td

View File

@ -29,6 +29,7 @@ class Td;
class AttachMenuManager final : public Actor {
public:
void memory_stats(vector<string> &output);
AttachMenuManager(Td *td, ActorShared<> parent);
void init();

View File

@ -310,8 +310,7 @@ tl_object_ptr<telegram_api::InputMedia> AudiosManager::get_input_media(
}
void AudiosManager::memory_stats(vector<string> &output) {
output.push_back("\"audios_\":"); output.push_back(std::to_string(audios_.calc_size()));
output.emplace_back("\"audios_\":"); output.emplace_back(std::to_string(this->audios_.calc_size()));
}
} // namespace td

View File

@ -22,6 +22,7 @@ class Td;
class AudiosManager {
public:
void memory_stats(vector<string> &output);
explicit AudiosManager(Td *td);
AudiosManager(const AudiosManager &) = delete;
AudiosManager &operator=(const AudiosManager &) = delete;
@ -29,8 +30,6 @@ class AudiosManager {
AudiosManager &operator=(AudiosManager &&) = delete;
~AudiosManager();
void memory_stats(vector<string> &output);
int32 get_audio_duration(FileId file_id) const;
tl_object_ptr<td_api::audio> get_audio_object(FileId file_id) const;

View File

@ -1482,4 +1482,10 @@ void AuthManager::save_state() {
G()->td_db()->get_binlog_pmc()->set("auth_state", log_event_store(db_state).as_slice().str());
}
void AuthManager::memory_stats(vector<string> &output) {
output.emplace_back("\"other_user_ids_\":"); output.emplace_back(std::to_string(this->other_user_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_authorization_state_requests_\":"); output.emplace_back(std::to_string(this->pending_get_authorization_state_requests_.size()));
}
} // namespace td

View File

@ -26,6 +26,7 @@ namespace td {
class AuthManager final : public NetActor {
public:
void memory_stats(vector<string> &output);
AuthManager(int32 api_id, const string &api_hash, ActorShared<> parent);
bool is_bot() const {

View File

@ -552,4 +552,8 @@ void AutosaveManager::get_current_state(vector<td_api::object_ptr<td_api::Update
}
}
void AutosaveManager::memory_stats(vector<string> &output) {
output.emplace_back("\"load_settings_queries_\":"); output.emplace_back(std::to_string(this->load_settings_queries_.size()));
}
} // namespace td

View File

@ -23,6 +23,7 @@ class Td;
class AutosaveManager final : public Actor {
public:
void memory_stats(vector<string> &output);
AutosaveManager(Td *td, ActorShared<> parent);
void reload_autosave_settings();

View File

@ -1492,17 +1492,23 @@ void BackgroundManager::get_current_state(vector<td_api::object_ptr<td_api::Upda
}
void BackgroundManager::memory_stats(vector<string> &output) {
output.push_back("\"backgrounds_\":"); output.push_back(std::to_string(backgrounds_.size()));
output.push_back(",");
output.push_back("\"background_id_to_file_source_id_\":"); output.push_back(std::to_string(background_id_to_file_source_id_.size()));
output.push_back(",");
output.push_back("\"name_to_background_id_\":"); output.push_back(std::to_string(name_to_background_id_.size()));
output.push_back(",");
output.push_back("\"file_id_to_background_id_\":"); output.push_back(std::to_string(file_id_to_background_id_.size()));
output.push_back(",");
output.push_back("\"loaded_from_database_backgrounds_\":"); output.push_back(std::to_string(loaded_from_database_backgrounds_.size()));
output.push_back(",");
output.push_back("\"installed_backgrounds_\":"); output.push_back(std::to_string(installed_backgrounds_.size()));
output.emplace_back("\"backgrounds_\":"); output.emplace_back(std::to_string(this->backgrounds_.size()));
output.emplace_back(",");
output.emplace_back("\"background_id_to_file_source_id_\":"); output.emplace_back(std::to_string(this->background_id_to_file_source_id_.size()));
output.emplace_back(",");
output.emplace_back("\"name_to_background_id_\":"); output.emplace_back(std::to_string(this->name_to_background_id_.size()));
output.emplace_back(",");
output.emplace_back("\"file_id_to_background_id_\":"); output.emplace_back(std::to_string(this->file_id_to_background_id_.size()));
output.emplace_back(",");
output.emplace_back("\"loaded_from_database_backgrounds_\":"); output.emplace_back(std::to_string(this->loaded_from_database_backgrounds_.size()));
output.emplace_back(",");
output.emplace_back("\"being_loaded_from_database_backgrounds_\":"); output.emplace_back(std::to_string(this->being_loaded_from_database_backgrounds_.size()));
output.emplace_back(",");
output.emplace_back("\"installed_backgrounds_\":"); output.emplace_back(std::to_string(this->installed_backgrounds_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_backgrounds_queries_\":"); output.emplace_back(std::to_string(this->pending_get_backgrounds_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"being_uploaded_files_\":"); output.emplace_back(std::to_string(this->being_uploaded_files_.size()));
}
} // namespace td

View File

@ -33,9 +33,8 @@ class Td;
class BackgroundManager final : public Actor {
public:
BackgroundManager(Td *td, ActorShared<> parent);
void memory_stats(vector<string> &output);
BackgroundManager(Td *td, ActorShared<> parent);
void get_backgrounds(bool for_dark_theme, Promise<td_api::object_ptr<td_api::backgrounds>> &&promise);

View File

@ -510,4 +510,7 @@ void BoostManager::on_update_dialog_boost(DialogId dialog_id, telegram_api::obje
td_->dialog_manager_->get_chat_id_object(dialog_id, "updateChatBoost"), std::move(chat_boost_object)));
}
void BoostManager::memory_stats(vector<string> &output) {
}
} // namespace td

View File

@ -27,6 +27,7 @@ class Td;
class BoostManager final : public Actor {
public:
void memory_stats(vector<string> &output);
BoostManager(Td *td, ActorShared<> parent);
td_api::object_ptr<td_api::chatBoostLevelFeatures> get_chat_boost_level_features_object(bool for_megagroup,

View File

@ -442,4 +442,10 @@ void BotInfoManager::get_bot_info_about(UserId bot_user_id, const string &langua
add_pending_get_query(bot_user_id, language_code, 2, std::move(promise));
}
void BotInfoManager::memory_stats(vector<string> &output) {
output.emplace_back("\"pending_set_bot_info_queries_\":"); output.emplace_back(std::to_string(this->pending_set_bot_info_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_bot_info_queries_\":"); output.emplace_back(std::to_string(this->pending_get_bot_info_queries_.size()));
}
} // namespace td

View File

@ -20,6 +20,7 @@ class Td;
class BotInfoManager final : public Actor {
public:
void memory_stats(vector<string> &output);
BotInfoManager(Td *td, ActorShared<> parent);
void set_default_group_administrator_rights(AdministratorRights administrator_rights, Promise<Unit> &&promise);

View File

@ -292,4 +292,7 @@ void BusinessManager::set_business_away_message(BusinessAwayMessage &&away_messa
td_->create_handler<UpdateBusinessAwayMessageQuery>(std::move(promise))->send(std::move(away_message));
}
void BusinessManager::memory_stats(vector<string> &output) {
}
} // namespace td

View File

@ -24,6 +24,7 @@ class Td;
class BusinessManager final : public Actor {
public:
void memory_stats(vector<string> &output);
BusinessManager(Td *td, ActorShared<> parent);
void get_business_connected_bot(Promise<td_api::object_ptr<td_api::businessConnectedBot>> &&promise);

View File

@ -290,4 +290,7 @@ void CallbackQueriesManager::send_get_callback_answer_query(
->send(dialog_id, message_full_id.get_message_id(), payload, std::move(password));
}
void CallbackQueriesManager::memory_stats(vector<string> &output) {
}
} // namespace td

View File

@ -23,6 +23,7 @@ class Td;
class CallbackQueriesManager {
public:
void memory_stats(vector<string> &output);
explicit CallbackQueriesManager(Td *td);
void answer_callback_query(int64 callback_query_id, const string &text, bool show_alert, const string &url,

View File

@ -221,4 +221,8 @@ void CommonDialogManager::on_get_common_dialogs(UserId user_id, int64 offset_cha
common_dialogs.total_count = total_count;
}
void CommonDialogManager::memory_stats(vector<string> &output) {
output.emplace_back("\"found_common_dialogs_\":"); output.emplace_back(std::to_string(this->found_common_dialogs_.size()));
}
} // namespace td

View File

@ -24,6 +24,7 @@ class Td;
class CommonDialogManager final : public Actor {
public:
void memory_stats(vector<string> &output);
CommonDialogManager(Td *td, ActorShared<> parent);
CommonDialogManager(const CommonDialogManager &) = delete;
CommonDialogManager &operator=(const CommonDialogManager &) = delete;

View File

@ -17038,95 +17038,117 @@ void ContactsManager::get_current_state(vector<td_api::object_ptr<td_api::Update
}
void ContactsManager::memory_stats(vector<string> &output) {
output.push_back("\"users_\":"); output.push_back(std::to_string(users_.calc_size()));
output.push_back(",");
output.push_back("\"users_full_\":"); output.push_back(std::to_string(users_full_.calc_size()));
output.push_back(",");
output.push_back("\"user_photos_\":"); output.push_back(std::to_string(user_photos_.calc_size()));
output.push_back(",");
output.push_back("\"unknown_users_\":"); output.push_back(std::to_string(unknown_users_.size()));
output.push_back(",");
output.push_back("\"pending_user_photos_\":"); output.push_back(std::to_string(pending_user_photos_.calc_size()));
output.push_back(",");
output.push_back("\"user_profile_photo_file_source_ids_\":"); output.push_back(std::to_string(user_profile_photo_file_source_ids_.calc_size()));
output.push_back(",");
output.push_back("\"my_photo_file_id_\":"); output.push_back(std::to_string(my_photo_file_id_.size()));
output.push_back(",");
output.push_back("\"chats_\":"); output.push_back(std::to_string(chats_.calc_size()));
output.push_back(",");
output.push_back("\"chats_full_\":"); output.push_back(std::to_string(chats_full_.calc_size()));
output.push_back(",");
output.push_back("\"unknown_chats_\":"); output.push_back(std::to_string(unknown_chats_.size()));
output.push_back(",");
output.push_back("\"chat_full_file_source_ids_\":"); output.push_back(std::to_string(chat_full_file_source_ids_.calc_size()));
output.push_back(",");
output.push_back("\"min_channels_\":"); output.push_back(std::to_string(min_channels_.calc_size()));
output.push_back(",");
output.push_back("\"channels_\":"); output.push_back(std::to_string(channels_.calc_size()));
output.push_back(",");
output.push_back("\"channels_full_\":"); output.push_back(std::to_string(channels_full_.calc_size()));
output.push_back(",");
output.push_back("\"unknown_channels_\":"); output.push_back(std::to_string(unknown_channels_.size()));
output.push_back(",");
output.push_back("\"channel_full_file_source_ids_\":"); output.push_back(std::to_string(channel_full_file_source_ids_.calc_size()));
output.push_back(",");
output.push_back("\"secret_chats_\":"); output.push_back(std::to_string(secret_chats_.calc_size()));
output.push_back(",");
output.push_back("\"unknown_secret_chats_\":"); output.push_back(std::to_string(unknown_secret_chats_.size()));
output.push_back(",");
output.push_back("\"secret_chats_with_user_\":"); output.push_back(std::to_string(secret_chats_with_user_.size()));
output.push_back(",");
output.push_back("\"load_user_from_database_queries_\":"); output.push_back(std::to_string(load_user_from_database_queries_.size()));
output.push_back(",");
output.push_back("\"loaded_from_database_users_\":"); output.push_back(std::to_string(loaded_from_database_users_.size()));
output.push_back(",");
output.push_back("\"unavailable_user_fulls_\":"); output.push_back(std::to_string(unavailable_user_fulls_.size()));
output.push_back(",");
output.push_back("\"load_chat_from_database_queries_\":"); output.push_back(std::to_string(load_chat_from_database_queries_.size()));
output.push_back(",");
output.push_back("\"loaded_from_database_chats_\":"); output.push_back(std::to_string(loaded_from_database_chats_.size()));
output.push_back(",");
output.push_back("\"unavailable_chat_fulls_\":"); output.push_back(std::to_string(unavailable_chat_fulls_.size()));
output.push_back(",");
output.push_back("\"load_channel_from_database_queries_\":"); output.push_back(std::to_string(load_channel_from_database_queries_.size()));
output.push_back(",");
output.push_back("\"loaded_from_database_channels_\":"); output.push_back(std::to_string(loaded_from_database_channels_.size()));
output.push_back(",");
output.push_back("\"unavailable_channel_fulls_\":"); output.push_back(std::to_string(unavailable_channel_fulls_.size()));
output.push_back(",");
output.push_back("\"load_secret_chat_from_database_queries_\":"); output.push_back(std::to_string(load_secret_chat_from_database_queries_.size()));
output.push_back(",");
output.push_back("\"loaded_from_database_secret_chats_\":"); output.push_back(std::to_string(loaded_from_database_secret_chats_.size()));
output.push_back(",");
output.push_back("\"uploaded_profile_photos_\":"); output.push_back(std::to_string(uploaded_profile_photos_.size()));
output.push_back(",");
output.push_back("\"imported_contacts_\":"); output.push_back(std::to_string(imported_contacts_.size()));
output.push_back(",");
output.push_back("\"cached_channel_participants_\":"); output.push_back(std::to_string(cached_channel_participants_.size()));
output.push_back(",");
output.push_back("\"load_contacts_queries_\":"); output.push_back(std::to_string(load_contacts_queries_.size()));
output.push_back(",");
output.push_back("\"load_imported_contacts_queries_\":"); output.push_back(std::to_string(load_imported_contacts_queries_.size()));
output.push_back(",");
output.push_back("\"all_imported_contacts_\":"); output.push_back(std::to_string(all_imported_contacts_.size()));
output.push_back(",");
output.push_back("\"users_nearby_\":"); output.push_back(std::to_string(users_nearby_.size()));
output.push_back(",");
output.push_back("\"channels_nearby_\":"); output.push_back(std::to_string(channels_nearby_.size()));
output.push_back(",");
output.push_back("\"all_users_nearby_\":"); output.push_back(std::to_string(all_users_nearby_.size()));
output.push_back(",");
output.push_back("\"linked_channel_ids_\":"); output.push_back(std::to_string(linked_channel_ids_.calc_size()));
output.push_back(",");
output.push_back("\"restricted_user_ids_\":"); output.push_back(std::to_string(restricted_user_ids_.calc_size()));
output.push_back(",");
output.push_back("\"restricted_channel_ids_\":"); output.push_back(std::to_string(restricted_channel_ids_.calc_size()));
output.push_back(",");
output.push_back("\"next_all_imported_contacts_\":"); output.push_back(std::to_string(next_all_imported_contacts_.size()));
output.push_back(",");
output.push_back("\"imported_contact_user_ids_\":"); output.push_back(std::to_string(imported_contact_user_ids_.size()));
output.push_back(",");
output.push_back("\"unimported_contact_invites_\":"); output.push_back(std::to_string(unimported_contact_invites_.size()));
output.emplace_back("\"users_\":"); output.emplace_back(std::to_string(this->users_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"users_full_\":"); output.emplace_back(std::to_string(this->users_full_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"user_photos_\":"); output.emplace_back(std::to_string(this->user_photos_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"unknown_users_\":"); output.emplace_back(std::to_string(this->unknown_users_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_user_photos_\":"); output.emplace_back(std::to_string(this->pending_user_photos_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"user_profile_photo_file_source_ids_\":"); output.emplace_back(std::to_string(this->user_profile_photo_file_source_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"my_photo_file_id_\":"); output.emplace_back(std::to_string(this->my_photo_file_id_.size()));
output.emplace_back(",");
output.emplace_back("\"user_full_file_source_ids_\":"); output.emplace_back(std::to_string(this->user_full_file_source_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"chats_\":"); output.emplace_back(std::to_string(this->chats_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"chats_full_\":"); output.emplace_back(std::to_string(this->chats_full_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"unknown_chats_\":"); output.emplace_back(std::to_string(this->unknown_chats_.size()));
output.emplace_back(",");
output.emplace_back("\"chat_full_file_source_ids_\":"); output.emplace_back(std::to_string(this->chat_full_file_source_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"min_channels_\":"); output.emplace_back(std::to_string(this->min_channels_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"channels_\":"); output.emplace_back(std::to_string(this->channels_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"channels_full_\":"); output.emplace_back(std::to_string(this->channels_full_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"unknown_channels_\":"); output.emplace_back(std::to_string(this->unknown_channels_.size()));
output.emplace_back(",");
output.emplace_back("\"invalidated_channels_full_\":"); output.emplace_back(std::to_string(this->invalidated_channels_full_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"channel_full_file_source_ids_\":"); output.emplace_back(std::to_string(this->channel_full_file_source_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"secret_chats_\":"); output.emplace_back(std::to_string(this->secret_chats_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"unknown_secret_chats_\":"); output.emplace_back(std::to_string(this->unknown_secret_chats_.size()));
output.emplace_back(",");
output.emplace_back("\"secret_chats_with_user_\":"); output.emplace_back(std::to_string(this->secret_chats_with_user_.size()));
output.emplace_back(",");
output.emplace_back("\"channel_recommended_dialogs_\":"); output.emplace_back(std::to_string(this->channel_recommended_dialogs_.size()));
output.emplace_back(",");
output.emplace_back("\"get_channel_recommendations_queries_\":"); output.emplace_back(std::to_string(this->get_channel_recommendations_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"dialogs_for_discussion_\":"); output.emplace_back(std::to_string(this->dialogs_for_discussion_.size()));
output.emplace_back(",");
output.emplace_back("\"inactive_channel_ids_\":"); output.emplace_back(std::to_string(this->inactive_channel_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"load_user_from_database_queries_\":"); output.emplace_back(std::to_string(this->load_user_from_database_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"loaded_from_database_users_\":"); output.emplace_back(std::to_string(this->loaded_from_database_users_.size()));
output.emplace_back(",");
output.emplace_back("\"unavailable_user_fulls_\":"); output.emplace_back(std::to_string(this->unavailable_user_fulls_.size()));
output.emplace_back(",");
output.emplace_back("\"load_chat_from_database_queries_\":"); output.emplace_back(std::to_string(this->load_chat_from_database_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"loaded_from_database_chats_\":"); output.emplace_back(std::to_string(this->loaded_from_database_chats_.size()));
output.emplace_back(",");
output.emplace_back("\"unavailable_chat_fulls_\":"); output.emplace_back(std::to_string(this->unavailable_chat_fulls_.size()));
output.emplace_back(",");
output.emplace_back("\"load_channel_from_database_queries_\":"); output.emplace_back(std::to_string(this->load_channel_from_database_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"loaded_from_database_channels_\":"); output.emplace_back(std::to_string(this->loaded_from_database_channels_.size()));
output.emplace_back(",");
output.emplace_back("\"unavailable_channel_fulls_\":"); output.emplace_back(std::to_string(this->unavailable_channel_fulls_.size()));
output.emplace_back(",");
output.emplace_back("\"load_secret_chat_from_database_queries_\":"); output.emplace_back(std::to_string(this->load_secret_chat_from_database_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"loaded_from_database_secret_chats_\":"); output.emplace_back(std::to_string(this->loaded_from_database_secret_chats_.size()));
output.emplace_back(",");
output.emplace_back("\"dialog_suggested_actions_\":"); output.emplace_back(std::to_string(this->dialog_suggested_actions_.size()));
output.emplace_back(",");
output.emplace_back("\"dismiss_suggested_action_queries_\":"); output.emplace_back(std::to_string(this->dismiss_suggested_action_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"uploaded_profile_photos_\":"); output.emplace_back(std::to_string(this->uploaded_profile_photos_.size()));
output.emplace_back(",");
output.emplace_back("\"import_contact_tasks_\":"); output.emplace_back(std::to_string(this->import_contact_tasks_.size()));
output.emplace_back(",");
output.emplace_back("\"imported_contacts_\":"); output.emplace_back(std::to_string(this->imported_contacts_.size()));
output.emplace_back(",");
output.emplace_back("\"resolved_phone_numbers_\":"); output.emplace_back(std::to_string(this->resolved_phone_numbers_.size()));
output.emplace_back(",");
output.emplace_back("\"user_messages_\":"); output.emplace_back(std::to_string(this->user_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"channel_messages_\":"); output.emplace_back(std::to_string(this->channel_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"load_contacts_queries_\":"); output.emplace_back(std::to_string(this->load_contacts_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"load_imported_contacts_queries_\":"); output.emplace_back(std::to_string(this->load_imported_contacts_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"all_imported_contacts_\":"); output.emplace_back(std::to_string(this->all_imported_contacts_.size()));
output.emplace_back(",");
output.emplace_back("\"user_full_contact_require_premium_\":"); output.emplace_back(std::to_string(this->user_full_contact_require_premium_.size()));
output.emplace_back(",");
output.emplace_back("\"linked_channel_ids_\":"); output.emplace_back(std::to_string(this->linked_channel_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"restricted_user_ids_\":"); output.emplace_back(std::to_string(this->restricted_user_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"restricted_channel_ids_\":"); output.emplace_back(std::to_string(this->restricted_channel_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"next_all_imported_contacts_\":"); output.emplace_back(std::to_string(this->next_all_imported_contacts_.size()));
output.emplace_back(",");
output.emplace_back("\"imported_contacts_unique_id_\":"); output.emplace_back(std::to_string(this->imported_contacts_unique_id_.size()));
output.emplace_back(",");
output.emplace_back("\"imported_contacts_pos_\":"); output.emplace_back(std::to_string(this->imported_contacts_pos_.size()));
output.emplace_back(",");
output.emplace_back("\"imported_contact_user_ids_\":"); output.emplace_back(std::to_string(this->imported_contact_user_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"unimported_contact_invites_\":"); output.emplace_back(std::to_string(this->unimported_contact_invites_.size()));
}
} // namespace td

View File

@ -74,6 +74,7 @@ class Td;
class ContactsManager final : public Actor {
public:
void memory_stats(vector<string> &output);
ContactsManager(Td *td, ActorShared<> parent);
ContactsManager(const ContactsManager &) = delete;
ContactsManager &operator=(const ContactsManager &) = delete;
@ -83,8 +84,6 @@ class ContactsManager final : public Actor {
static UserId load_my_id();
void memory_stats(vector<string> &output);
static UserId get_user_id(const tl_object_ptr<telegram_api::User> &user);
static ChatId get_chat_id(const tl_object_ptr<telegram_api::Chat> &chat);
static ChannelId get_channel_id(const tl_object_ptr<telegram_api::Chat> &chat);

View File

@ -610,4 +610,8 @@ FlatHashMap<string, unique_ptr<CountryInfoManager::CountryList>> CountryInfoMana
string CountryInfoManager::fragment_prefixes_str_;
vector<string> CountryInfoManager::fragment_prefixes_;
void CountryInfoManager::memory_stats(vector<string> &output) {
output.emplace_back("\"pending_load_country_queries_\":"); output.emplace_back(std::to_string(this->pending_load_country_queries_.size()));
}
} // namespace td

View File

@ -25,6 +25,7 @@ class Td;
class CountryInfoManager final : public Actor {
public:
void memory_stats(vector<string> &output);
CountryInfoManager(Td *td, ActorShared<> parent);
void get_countries(Promise<td_api::object_ptr<td_api::countries>> &&promise);

View File

@ -401,4 +401,10 @@ void DialogActionManager::clear_active_dialog_actions(DialogId dialog_id) {
}
}
void DialogActionManager::memory_stats(vector<string> &output) {
output.emplace_back("\"active_dialog_actions_\":"); output.emplace_back(std::to_string(this->active_dialog_actions_.size()));
output.emplace_back(",");
output.emplace_back("\"set_typing_query_\":"); output.emplace_back(std::to_string(this->set_typing_query_.size()));
}
} // namespace td

View File

@ -25,6 +25,7 @@ class Td;
class DialogActionManager final : public Actor {
public:
void memory_stats(vector<string> &output);
DialogActionManager(Td *td, ActorShared<> parent);
void on_dialog_action(DialogId dialog_id, MessageId top_thread_message_id, DialogId typing_dialog_id,

View File

@ -2210,4 +2210,14 @@ void DialogFilterManager::get_current_state(vector<td_api::object_ptr<td_api::Up
}
}
void DialogFilterManager::memory_stats(vector<string> &output) {
output.emplace_back("\"server_dialog_filters_\":"); output.emplace_back(std::to_string(this->server_dialog_filters_.size()));
output.emplace_back(",");
output.emplace_back("\"dialog_filters_\":"); output.emplace_back(std::to_string(this->dialog_filters_.size()));
output.emplace_back(",");
output.emplace_back("\"dialog_filter_reload_queries_\":"); output.emplace_back(std::to_string(this->dialog_filter_reload_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"recommended_dialog_filters_\":"); output.emplace_back(std::to_string(this->recommended_dialog_filters_.size()));
}
} // namespace td

View File

@ -28,6 +28,7 @@ class Td;
class DialogFilterManager final : public Actor {
public:
void memory_stats(vector<string> &output);
DialogFilterManager(Td *td, ActorShared<> parent);
DialogFilterManager(const DialogFilterManager &) = delete;
DialogFilterManager &operator=(const DialogFilterManager &) = delete;

View File

@ -1097,4 +1097,10 @@ void DialogInviteLinkManager::delete_all_revoked_dialog_invite_links(DialogId di
->send(dialog_id, std::move(input_user));
}
void DialogInviteLinkManager::memory_stats(vector<string> &output) {
output.emplace_back("\"invite_link_infos_\":"); output.emplace_back(std::to_string(this->invite_link_infos_.size()));
output.emplace_back(",");
output.emplace_back("\"dialog_access_by_invite_link_\":"); output.emplace_back(std::to_string(this->dialog_access_by_invite_link_.size()));
}
} // namespace td

View File

@ -28,6 +28,7 @@ class Td;
class DialogInviteLinkManager final : public Actor {
public:
void memory_stats(vector<string> &output);
DialogInviteLinkManager(Td *td, ActorShared<> parent);
DialogInviteLinkManager(const DialogInviteLinkManager &) = delete;
DialogInviteLinkManager &operator=(const DialogInviteLinkManager &) = delete;

View File

@ -2161,4 +2161,16 @@ void DialogManager::drop_username(const string &username) {
}
}
void DialogManager::memory_stats(vector<string> &output) {
output.emplace_back("\"being_uploaded_dialog_photos_\":"); output.emplace_back(std::to_string(this->being_uploaded_dialog_photos_.size()));
output.emplace_back(",");
output.emplace_back("\"resolved_usernames_\":"); output.emplace_back(std::to_string(this->resolved_usernames_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"inaccessible_resolved_usernames_\":"); output.emplace_back(std::to_string(this->inaccessible_resolved_usernames_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"reload_voice_chat_on_search_usernames_\":"); output.emplace_back(std::to_string(this->reload_voice_chat_on_search_usernames_.size()));
output.emplace_back(",");
output.emplace_back("\"resolve_dialog_username_queries_\":"); output.emplace_back(std::to_string(this->resolve_dialog_username_queries_.size()));
}
} // namespace td

View File

@ -42,6 +42,7 @@ class Usernames;
class DialogManager final : public Actor {
public:
void memory_stats(vector<string> &output);
DialogManager(Td *td, ActorShared<> parent);
DialogManager(const DialogManager &) = delete;
DialogManager &operator=(const DialogManager &) = delete;

View File

@ -2995,4 +2995,18 @@ void DialogParticipantManager::get_current_state(vector<td_api::object_ptr<td_ap
}
}
void DialogParticipantManager::memory_stats(vector<string> &output) {
output.emplace_back("\"dialog_online_member_counts_\":"); output.emplace_back(std::to_string(this->dialog_online_member_counts_.size()));
output.emplace_back(",");
output.emplace_back("\"user_online_member_dialogs_\":"); output.emplace_back(std::to_string(this->user_online_member_dialogs_.size()));
output.emplace_back(",");
output.emplace_back("\"dialog_administrators_\":"); output.emplace_back(std::to_string(this->dialog_administrators_.size()));
output.emplace_back(",");
output.emplace_back("\"channel_participants_\":"); output.emplace_back(std::to_string(this->channel_participants_.size()));
output.emplace_back(",");
output.emplace_back("\"cached_channel_participants_\":"); output.emplace_back(std::to_string(this->cached_channel_participants_.size()));
output.emplace_back(",");
output.emplace_back("\"join_channel_queries_\":"); output.emplace_back(std::to_string(this->join_channel_queries_.size()));
}
} // namespace td

View File

@ -35,6 +35,7 @@ class Td;
class DialogParticipantManager final : public Actor {
public:
void memory_stats(vector<string> &output);
DialogParticipantManager(Td *td, ActorShared<> parent);
DialogParticipantManager(const DialogParticipantManager &) = delete;
DialogParticipantManager &operator=(const DialogParticipantManager &) = delete;

View File

@ -757,9 +757,6 @@ void DocumentsManager::merge_documents(FileId new_id, FileId old_id) {
LOG_STATUS(td_->file_manager_->merge(new_id, old_id));
}
void DocumentsManager::memory_stats(vector<string> &output) {
output.push_back("\"documents_\":"); output.push_back(std::to_string(documents_.calc_size()));
}
string DocumentsManager::get_document_search_text(FileId file_id) const {
auto document = get_document(file_id);
@ -782,4 +779,8 @@ string DocumentsManager::get_document_search_text(FileId file_id) const {
return sb.as_cslice().str();
}
void DocumentsManager::memory_stats(vector<string> &output) {
output.emplace_back("\"documents_\":"); output.emplace_back(std::to_string(this->documents_.calc_size()));
}
} // namespace td

View File

@ -30,6 +30,7 @@ class Td;
class DocumentsManager {
public:
void memory_stats(vector<string> &output);
explicit DocumentsManager(Td *td);
DocumentsManager(const DocumentsManager &) = delete;
DocumentsManager &operator=(const DocumentsManager &) = delete;
@ -82,7 +83,6 @@ class DocumentsManager {
tl_object_ptr<td_api::document> get_document_object(FileId file_id, PhotoFormat thumbnail_format) const;
void memory_stats(vector<string> &output);
enum class Subtype : int32 { Background, Pattern, Ringtone, Story, Other };
Document on_get_document(RemoteDocument remote_document, DialogId owner_dialog_id,

View File

@ -839,4 +839,7 @@ void DownloadManager::Counters::parse(ParserT &parser) {
td::parse(downloaded_size, parser);
}
void DownloadManager::memory_stats(vector<string> &output) {
}
} // namespace td

View File

@ -20,6 +20,7 @@ namespace td {
class DownloadManager : public Actor {
public:
void memory_stats(vector<string> &output);
struct Counters {
int64 total_size{};
int32 total_count{};

View File

@ -508,9 +508,7 @@ td_api::object_ptr<td_api::message> FileReferenceManager::get_message_object(Fil
}
void FileReferenceManager::memory_stats(vector<string> &output) {
output.push_back("\"nodes_\":"); output.push_back(std::to_string(nodes_.calc_size()));
output.push_back(",");
output.push_back("\"file_sources_\":"); output.push_back(std::to_string(file_sources_.size()));
output.emplace_back("\"nodes_\":"); output.emplace_back(std::to_string(this->nodes_.calc_size()));
}
} // namespace td

View File

@ -38,6 +38,7 @@ extern int VERBOSITY_NAME(file_references);
class FileReferenceManager final : public Actor {
public:
void memory_stats(vector<string> &output);
explicit FileReferenceManager(ActorShared<> parent);
FileReferenceManager(const FileReferenceManager &) = delete;
FileReferenceManager &operator=(const FileReferenceManager &) = delete;
@ -94,8 +95,6 @@ class FileReferenceManager final : public Actor {
template <class ParserT>
FileSourceId parse_file_source(Td *td, ParserT &parser);
void memory_stats(vector<string> &output);
private:
struct Destination {
NodeId node_id;

View File

@ -1228,4 +1228,8 @@ void ForumTopicManager::on_topic_message_count_changed(DialogId dialog_id, Messa
}
}
void ForumTopicManager::memory_stats(vector<string> &output) {
output.emplace_back("\"dialog_topics_\":"); output.emplace_back(std::to_string(this->dialog_topics_.calc_size()));
}
} // namespace td

View File

@ -32,6 +32,7 @@ class Td;
class ForumTopicManager final : public Actor {
public:
void memory_stats(vector<string> &output);
ForumTopicManager(Td *td, ActorShared<> parent);
ForumTopicManager(const ForumTopicManager &) = delete;
ForumTopicManager &operator=(const ForumTopicManager &) = delete;

View File

@ -305,4 +305,7 @@ td_api::object_ptr<td_api::gameHighScores> GameManager::get_game_high_scores_obj
return result;
}
void GameManager::memory_stats(vector<string> &output) {
}
} // namespace td

View File

@ -22,6 +22,7 @@ class Td;
class GameManager final : public Actor {
public:
void memory_stats(vector<string> &output);
GameManager(Td *td, ActorShared<> parent);
GameManager(const GameManager &) = delete;
GameManager &operator=(const GameManager &) = delete;

View File

@ -1006,17 +1006,6 @@ void GroupCallManager::tear_down() {
parent_.reset();
}
void GroupCallManager::memory_stats(vector<string> &output) {
output.push_back("\"group_call_participants_\":"); output.push_back(std::to_string(group_call_participants_.size()));
output.push_back(",");
output.push_back("\"group_call_recent_speakers_\":"); output.push_back(std::to_string(group_call_recent_speakers_.size()));
output.push_back(",");
output.push_back("\"group_calls_\":"); output.push_back(std::to_string(group_calls_.size()));
output.push_back(",");
output.push_back("\"input_group_call_ids_\":"); output.push_back(std::to_string(input_group_call_ids_.size()));
output.push_back(",");
output.push_back("\"pending_join_requests_\":"); output.push_back(std::to_string(pending_join_requests_.size()));
}
void GroupCallManager::on_update_group_call_participant_order_timeout_callback(void *group_call_manager_ptr,
int64 group_call_id_int) {
@ -4915,4 +4904,22 @@ void GroupCallManager::send_update_group_call_participant(InputGroupCallId input
send_update_group_call_participant(group_call->group_call_id, participant, source);
}
void GroupCallManager::memory_stats(vector<string> &output) {
output.emplace_back("\"input_group_call_ids_\":"); output.emplace_back(std::to_string(this->input_group_call_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"group_calls_\":"); output.emplace_back(std::to_string(this->group_calls_.size()));
output.emplace_back(",");
output.emplace_back("\"group_call_participants_\":"); output.emplace_back(std::to_string(this->group_call_participants_.size()));
output.emplace_back(",");
output.emplace_back("\"participant_id_to_group_call_id_\":"); output.emplace_back(std::to_string(this->participant_id_to_group_call_id_.size()));
output.emplace_back(",");
output.emplace_back("\"group_call_recent_speakers_\":"); output.emplace_back(std::to_string(this->group_call_recent_speakers_.size()));
output.emplace_back(",");
output.emplace_back("\"load_group_call_queries_\":"); output.emplace_back(std::to_string(this->load_group_call_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_join_requests_\":"); output.emplace_back(std::to_string(this->pending_join_requests_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_join_presentation_requests_\":"); output.emplace_back(std::to_string(this->pending_join_presentation_requests_.size()));
}
} // namespace td

View File

@ -32,6 +32,7 @@ class Td;
class GroupCallManager final : public Actor {
public:
void memory_stats(vector<string> &output);
GroupCallManager(Td *td, ActorShared<> parent);
GroupCallManager(const GroupCallManager &) = delete;
GroupCallManager &operator=(const GroupCallManager &) = delete;
@ -39,8 +40,6 @@ class GroupCallManager final : public Actor {
GroupCallManager &operator=(GroupCallManager &&) = delete;
~GroupCallManager() final;
void memory_stats(vector<string> &output);
DialogId get_group_call_participant_id(const td_api::object_ptr<td_api::MessageSender> &message_sender);
bool is_group_call_being_joined(InputGroupCallId input_group_call_id) const;

View File

@ -2221,13 +2221,13 @@ void InlineQueriesManager::remove_recent_inline_bot(UserId bot_user_id, Promise<
}
void InlineQueriesManager::memory_stats(vector<string> &output) {
output.push_back("\"recently_used_bot_user_ids_\":"); output.push_back(std::to_string(recently_used_bot_user_ids_.size()));
output.push_back(",");
output.push_back("\"inline_query_results_\":"); output.push_back(std::to_string(inline_query_results_.size()));
output.push_back(",");
output.push_back("\"inline_message_contents_\":"); output.push_back(std::to_string(inline_message_contents_.size()));
output.push_back(",");
output.push_back("\"query_id_to_bot_user_id_\":"); output.push_back(std::to_string(query_id_to_bot_user_id_.size()));
output.emplace_back("\"recently_used_bot_user_ids_\":"); output.emplace_back(std::to_string(this->recently_used_bot_user_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"inline_query_results_\":"); output.emplace_back(std::to_string(this->inline_query_results_.size()));
output.emplace_back(",");
output.emplace_back("\"inline_message_contents_\":"); output.emplace_back(std::to_string(this->inline_message_contents_.size()));
output.emplace_back(",");
output.emplace_back("\"query_id_to_bot_user_id_\":"); output.emplace_back(std::to_string(this->query_id_to_bot_user_id_.size()));
}
} // namespace td

View File

@ -36,9 +36,8 @@ class Game;
class InlineQueriesManager final : public Actor {
public:
InlineQueriesManager(Td *td, ActorShared<> parent);
void memory_stats(vector<string> &output);
InlineQueriesManager(Td *td, ActorShared<> parent);
void after_get_difference();

View File

@ -3057,4 +3057,12 @@ Result<MessageLinkInfo> LinkManager::get_message_link_info(Slice url) {
return std::move(info);
}
void LinkManager::memory_stats(vector<string> &output) {
output.emplace_back("\"autologin_domains_\":"); output.emplace_back(std::to_string(this->autologin_domains_.size()));
output.emplace_back(",");
output.emplace_back("\"url_auth_domains_\":"); output.emplace_back(std::to_string(this->url_auth_domains_.size()));
output.emplace_back(",");
output.emplace_back("\"whitelisted_domains_\":"); output.emplace_back(std::to_string(this->whitelisted_domains_.size()));
}
} // namespace td

View File

@ -29,6 +29,7 @@ class Td;
class LinkManager final : public Actor {
public:
void memory_stats(vector<string> &output);
LinkManager(Td *td, ActorShared<> parent);
LinkManager(const LinkManager &) = delete;

View File

@ -11,30 +11,12 @@
#include "td/telegram/telegram_api.h"
#include "td/telegram/AccessRights.h"
#include "td/telegram/AuthManager.h"
#include "td/telegram/ConfigManager.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/Document.h"
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/FileReferenceManager.h"
#include "td/telegram/files/FileLocation.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/WebPagesManager.h"
#include "td/telegram/StickersManager.h"
#include "td/telegram/VideoNotesManager.h"
#include "td/telegram/VideosManager.h"
#include "td/telegram/AudiosManager.h"
#include "td/telegram/AnimationsManager.h"
#include "td/telegram/GroupCallManager.h"
#include "td/telegram/BackgroundManager.h"
#include "td/telegram/PollManager.h"
#include "td/telegram/InlineQueriesManager.h"
#include "td/telegram/files/FileType.h"
#include "td/telegram/Global.h"
#include "td/telegram/LanguagePackManager.h"
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/misc.h"
#include "td/telegram/net/DcId.h"
#include "td/telegram/net/MtprotoHeader.h"
@ -64,6 +46,60 @@
#include <unordered_set>
#include <numeric>
#include "td/telegram/CallbackQueriesManager.h"
#include "td/telegram/CountryInfoManager.h"
#include "td/telegram/DownloadManager.h"
#include "td/telegram/GameManager.h"
#include "td/telegram/LinkManager.h"
#include "td/telegram/OptionManager.h"
#include "td/telegram/PrivacyManager.h"
#include "td/telegram/SponsoredMessageManager.h"
#include "td/telegram/ThemeManager.h"
#include "td/telegram/VoiceNotesManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/AutosaveManager.h"
#include "td/telegram/TranslationManager.h"
#include "td/telegram/NotificationSettingsManager.h"
#include "td/telegram/ReactionManager.h"
#include "td/telegram/TopDialogManager.h"
#include "td/telegram/AttachMenuManager.h"
#include "td/telegram/AuthManager.h"
#include "td/telegram/BotInfoManager.h"
#include "td/telegram/ForumTopicManager.h"
#include "td/telegram/NotificationManager.h"
#include "td/telegram/AccountManager.h"
#include "td/telegram/StatisticsManager.h"
#include "td/telegram/BoostManager.h"
#include "td/telegram/CommonDialogManager.h"
#include "td/telegram/DialogActionManager.h"
#include "td/telegram/DialogInviteLinkManager.h"
#include "td/telegram/MessageImportManager.h"
#include "td/telegram/SavedMessagesManager.h"
#include "td/telegram/TranscriptionManager.h"
#include "td/telegram/BusinessManager.h"
#include "td/telegram/DialogFilterManager.h"
#include "td/telegram/DialogManager.h"
#include "td/telegram/DialogParticipantManager.h"
#include "td/telegram/PeopleNearbyManager.h"
#include "td/telegram/QuickReplyManager.h"
#include "td/telegram/StoryManager.h"
#include "td/telegram/TimeZoneManager.h"
#include "td/telegram/UpdatesManager.h"
#include "td/telegram/AnimationsManager.h"
#include "td/telegram/AudiosManager.h"
#include "td/telegram/BackgroundManager.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/DocumentsManager.h"
#include "td/telegram/FileReferenceManager.h"
#include "td/telegram/GroupCallManager.h"
#include "td/telegram/InlineQueriesManager.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/PollManager.h"
#include "td/telegram/StickersManager.h"
#include "td/telegram/VideoNotesManager.h"
#include "td/telegram/VideosManager.h"
#include "td/telegram/WebPagesManager.h"
namespace td {
tl_object_ptr<td_api::memoryStatistics> MemoryStats::get_memory_statistics_object() const {
@ -83,100 +119,13 @@ void MemoryManager::tear_down() {
void MemoryManager::get_memory_stats(bool full, Promise<MemoryStats> promise) const {
vector<string> output = {"{"};
output.push_back("\"memory_stats\":{");
output.emplace_back("\"memory_stats\":{");
output.push_back("\"messages_manager_\":{");
td_->messages_manager_->memory_stats(output);
output.push_back("}");
this->print_managers_memory_stats(output);
output.push_back(",");
output.emplace_back("}");
output.push_back("\"contacts_manager_\":{");
td_->contacts_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"web_pages_manager_\":{");
td_->web_pages_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"stickers_manager_\":{");
td_->stickers_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"documents_manager_\":{");
td_->documents_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"video_notes_manager_\":{");
td_->video_notes_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"videos_manager_\":{");
td_->videos_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"audios_manager_\":{");
td_->audios_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"animations_manager_\":{");
td_->animations_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"file_manager_\":{");
td_->file_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"file_reference_manager_\":{");
td_->file_reference_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"group_call_manager_\":{");
td_->group_call_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"background_manager_\":{");
td_->background_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"inline_queries_manager_\":{");
td_->inline_queries_manager_->memory_stats(output);
output.push_back("}");
output.push_back(",");
output.push_back("\"poll_manager_\":{");
td_->poll_manager_->memory_stats(output);
output.push_back("}");
output.push_back("}");
output.push_back("}");
output.emplace_back("}");
string s;
s = accumulate(output.begin(), output.end(), s);
@ -193,4 +142,112 @@ void MemoryManager::get_current_state(vector<td_api::object_ptr<td_api::Update>>
// Never return updates
}
void MemoryManager::print_managers_memory_stats(vector<string> &output) const {
output.emplace_back("\"callback_queries_manager_\":{"); td_->callback_queries_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"country_info_manager_\":{"); td_->country_info_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"download_manager_\":{"); td_->download_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"game_manager_\":{"); td_->game_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"link_manager_\":{"); td_->link_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"option_manager_\":{"); td_->option_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"privacy_manager_\":{"); td_->privacy_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"sponsored_message_manager_\":{"); td_->sponsored_message_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"theme_manager_\":{"); td_->theme_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"voice_notes_manager_\":{"); td_->voice_notes_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"file_manager_\":{"); td_->file_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"autosave_manager_\":{"); td_->autosave_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"translation_manager_\":{"); td_->translation_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"notification_settings_manager_\":{"); td_->notification_settings_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"reaction_manager_\":{"); td_->reaction_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"top_dialog_manager_\":{"); td_->top_dialog_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"attach_menu_manager_\":{"); td_->attach_menu_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"auth_manager_\":{"); td_->auth_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"bot_info_manager_\":{"); td_->bot_info_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"forum_topic_manager_\":{"); td_->forum_topic_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"notification_manager_\":{"); td_->notification_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"account_manager_\":{"); td_->account_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"statistics_manager_\":{"); td_->statistics_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"boost_manager_\":{"); td_->boost_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"common_dialog_manager_\":{"); td_->common_dialog_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"dialog_action_manager_\":{"); td_->dialog_action_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"dialog_invite_link_manager_\":{"); td_->dialog_invite_link_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"message_import_manager_\":{"); td_->message_import_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"saved_messages_manager_\":{"); td_->saved_messages_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"transcription_manager_\":{"); td_->transcription_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"business_manager_\":{"); td_->business_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"dialog_filter_manager_\":{"); td_->dialog_filter_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"dialog_manager_\":{"); td_->dialog_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"dialog_participant_manager_\":{"); td_->dialog_participant_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"people_nearby_manager_\":{"); td_->people_nearby_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"quick_reply_manager_\":{"); td_->quick_reply_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"story_manager_\":{"); td_->story_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"time_zone_manager_\":{"); td_->time_zone_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"updates_manager_\":{"); td_->updates_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"animations_manager_\":{"); td_->animations_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"audios_manager_\":{"); td_->audios_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"background_manager_\":{"); td_->background_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"contacts_manager_\":{"); td_->contacts_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"documents_manager_\":{"); td_->documents_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"file_reference_manager_\":{"); td_->file_reference_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"group_call_manager_\":{"); td_->group_call_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"inline_queries_manager_\":{"); td_->inline_queries_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"messages_manager_\":{"); td_->messages_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"poll_manager_\":{"); td_->poll_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"stickers_manager_\":{"); td_->stickers_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"video_notes_manager_\":{"); td_->video_notes_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"videos_manager_\":{"); td_->videos_manager_->memory_stats(output); output.emplace_back("}");
output.emplace_back(",");
output.emplace_back("\"web_pages_manager_\":{"); td_->web_pages_manager_->memory_stats(output); output.emplace_back("}");
}
} // namespace td

View File

@ -56,6 +56,8 @@ class MemoryManager : public Actor {
void tear_down() override;
void print_managers_memory_stats(vector<string> &output) const;
Td *td_;
ActorShared<> parent_;
};

View File

@ -579,4 +579,12 @@ void MessageImportManager::on_imported_message_attachments_uploaded(int64 random
td_->create_handler<StartImportHistoryQuery>(std::move(promise))->send(dialog_id, pending_message_import->import_id);
}
void MessageImportManager::memory_stats(vector<string> &output) {
output.emplace_back("\"being_uploaded_imported_messages_\":"); output.emplace_back(std::to_string(this->being_uploaded_imported_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"being_uploaded_imported_message_attachments_\":"); output.emplace_back(std::to_string(this->being_uploaded_imported_message_attachments_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_message_imports_\":"); output.emplace_back(std::to_string(this->pending_message_imports_.size()));
}
} // namespace td

View File

@ -27,6 +27,7 @@ class Td;
class MessageImportManager final : public Actor {
public:
void memory_stats(vector<string> &output);
MessageImportManager(Td *td, ActorShared<> parent);
void get_message_file_type(const string &message_file_head,

View File

@ -5698,69 +5698,6 @@ void MessagesManager::update_message_reply_count(Dialog *d, MessageId message_id
}
}
void MessagesManager::memory_stats(vector<string> &output) {
output.push_back("\"being_sent_messages_\":"); output.push_back(std::to_string(this->being_sent_messages_.size()));
output.push_back(",");
output.push_back("\"being_loaded_secret_thumbnails_\":"); output.push_back(std::to_string(this->being_loaded_secret_thumbnails_.size()));
output.push_back(",");
output.push_back("\"being_uploaded_files_\":"); output.push_back(std::to_string(this->being_uploaded_files_.size()));
output.push_back(",");
output.push_back("\"being_uploaded_thumbnails_\":"); output.push_back(std::to_string(this->being_uploaded_thumbnails_.size()));
output.push_back(",");
output.push_back("\"dialog_folders_\":"); output.push_back(std::to_string(this->dialog_folders_.size()));
output.push_back(",");
output.push_back("\"dialog_lists_\":"); output.push_back(std::to_string(this->dialog_lists_.size()));
output.push_back(",");
output.push_back("\"dialogs_\":"); output.push_back(std::to_string(this->dialogs_.calc_size()));
output.push_back(",");
output.push_back("\"found_call_messages_\":"); output.push_back(std::to_string(this->found_call_messages_.size()));
output.push_back(",");
output.push_back("\"found_dialog_messages_\":"); output.push_back(std::to_string(this->found_dialog_messages_.size()));
output.push_back(",");
output.push_back("\"found_dialog_messages_dialog_id_\":"); output.push_back(std::to_string(this->found_dialog_messages_dialog_id_.size()));
output.push_back(",");
output.push_back("\"found_fts_messages_\":"); output.push_back(std::to_string(this->found_fts_messages_.size()));
output.push_back(",");
output.push_back("\"postponed_channel_updates_\":"); output.push_back(std::to_string(this->postponed_channel_updates_.size()));
output.push_back(",");
output.push_back("\"is_channel_difference_finished_\":"); output.push_back(std::to_string(this->is_channel_difference_finished_.size()));
output.push_back(",");
output.push_back("\"get_dialogs_tasks_\":"); output.push_back(std::to_string(this->get_dialogs_tasks_.size()));
output.push_back(",");
output.push_back("\"dialog_bot_command_message_ids_\":"); output.push_back(std::to_string(this->dialog_bot_command_message_ids_.size()));
output.push_back(",");
output.push_back("\"found_messages_\":"); output.push_back(std::to_string(this->found_messages_.size()));
output.push_back(",");
output.push_back("\"found_on_server_dialogs_\":"); output.push_back(std::to_string(this->found_on_server_dialogs_.size()));
output.push_back(",");
output.push_back("\"found_public_dialogs_\":"); output.push_back(std::to_string(this->found_public_dialogs_.size()));
output.push_back(",");
output.push_back("\"loaded_dialogs_\":"); output.push_back(std::to_string(this->loaded_dialogs_.size()));
output.push_back(",");
output.push_back("\"search_public_dialogs_queries_\":"); output.push_back(std::to_string(this->search_public_dialogs_queries_.size()));
output.push_back(",");
output.push_back("\"message_embedding_codes_\":"); output.push_back(std::to_string(this->message_embedding_codes_->size()));
output.push_back(",");
output.push_back("\"message_full_id_to_file_source_id_\":"); output.push_back(std::to_string(this->message_full_id_to_file_source_id_.calc_size()));
output.push_back(",");
output.push_back("\"get_dialog_message_by_date_results_\":"); output.push_back(std::to_string(this->get_dialog_message_by_date_results_.size()));
output.push_back(",");
output.push_back("\"get_dialog_query_log_event_id_\":"); output.push_back(std::to_string(this->get_dialog_query_log_event_id_.size()));
output.push_back(",");
output.push_back("\"get_channel_difference_to_log_event_id_\":"); output.push_back(std::to_string(this->get_channel_difference_to_log_event_id_.size()));
output.push_back(",");
output.push_back("\"last_clear_history_message_id_to_dialog_id_\":"); output.push_back(std::to_string(this->last_clear_history_message_id_to_dialog_id_.size()));
output.push_back(",");
output.push_back("\"last_outgoing_forwarded_message_date_\":"); output.push_back(std::to_string(this->last_outgoing_forwarded_message_date_.size()));
output.push_back(",");
output.push_back("\"load_active_live_location_messages_queries_\":"); output.push_back(std::to_string(this->load_active_live_location_messages_queries_.size()));
output.push_back(",");
output.push_back("\"notification_group_id_to_dialog_id_\":"); output.push_back(std::to_string(this->notification_group_id_to_dialog_id_.size()));
output.push_back(",");
output.push_back("\"previous_repaired_read_inbox_max_message_id_\":"); output.push_back(std::to_string(this->previous_repaired_read_inbox_max_message_id_.size()));
output.push_back(",");
output.push_back("\"channel_get_difference_retry_timeouts_\":"); output.push_back(std::to_string(this->channel_get_difference_retry_timeouts_.size()));
}
bool MessagesManager::have_dialog_scheduled_messages_in_memory(const Dialog *d) {
return d->scheduled_messages != nullptr && !d->scheduled_messages->scheduled_messages_.empty();
@ -38439,4 +38376,150 @@ void MessagesManager::get_message_file_search_text(MessageFullId message_full_id
return promise.set_error(Status::Error(200, "File not found"));
}
void MessagesManager::memory_stats(vector<string> &output) {
output.emplace_back("\"being_uploaded_files_\":"); output.emplace_back(std::to_string(this->being_uploaded_files_.size()));
output.emplace_back(",");
output.emplace_back("\"being_uploaded_thumbnails_\":"); output.emplace_back(std::to_string(this->being_uploaded_thumbnails_.size()));
output.emplace_back(",");
output.emplace_back("\"being_loaded_secret_thumbnails_\":"); output.emplace_back(std::to_string(this->being_loaded_secret_thumbnails_.size()));
output.emplace_back(",");
output.emplace_back("\"being_sent_messages_\":"); output.emplace_back(std::to_string(this->being_sent_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"update_message_ids_\":"); output.emplace_back(std::to_string(this->update_message_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_message_group_sends_\":"); output.emplace_back(std::to_string(this->pending_message_group_sends_.size()));
output.emplace_back(",");
output.emplace_back("\"message_id_to_dialog_id_\":"); output.emplace_back(std::to_string(this->message_id_to_dialog_id_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"last_clear_history_message_id_to_dialog_id_\":"); output.emplace_back(std::to_string(this->last_clear_history_message_id_to_dialog_id_.size()));
output.emplace_back(",");
output.emplace_back("\"created_public_broadcasts_\":"); output.emplace_back(std::to_string(this->created_public_broadcasts_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_created_dialogs_\":"); output.emplace_back(std::to_string(this->pending_created_dialogs_.size()));
output.emplace_back(",");
output.emplace_back("\"dialogs_\":"); output.emplace_back(std::to_string(this->dialogs_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"loaded_dialogs_\":"); output.emplace_back(std::to_string(this->loaded_dialogs_.size()));
output.emplace_back(",");
output.emplace_back("\"failed_to_load_dialogs_\":"); output.emplace_back(std::to_string(this->failed_to_load_dialogs_.size()));
output.emplace_back(",");
output.emplace_back("\"postponed_chat_read_inbox_updates_\":"); output.emplace_back(std::to_string(this->postponed_chat_read_inbox_updates_.size()));
output.emplace_back(",");
output.emplace_back("\"search_public_dialogs_queries_\":"); output.emplace_back(std::to_string(this->search_public_dialogs_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"found_public_dialogs_\":"); output.emplace_back(std::to_string(this->found_public_dialogs_.size()));
output.emplace_back(",");
output.emplace_back("\"found_on_server_dialogs_\":"); output.emplace_back(std::to_string(this->found_on_server_dialogs_.size()));
output.emplace_back(",");
output.emplace_back("\"get_dialog_message_by_date_results_\":"); output.emplace_back(std::to_string(this->get_dialog_message_by_date_results_.size()));
output.emplace_back(",");
output.emplace_back("\"found_dialog_message_calendars_\":"); output.emplace_back(std::to_string(this->found_dialog_message_calendars_.size()));
output.emplace_back(",");
output.emplace_back("\"found_dialog_messages_\":"); output.emplace_back(std::to_string(this->found_dialog_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"found_dialog_messages_dialog_id_\":"); output.emplace_back(std::to_string(this->found_dialog_messages_dialog_id_.size()));
output.emplace_back(",");
output.emplace_back("\"found_messages_\":"); output.emplace_back(std::to_string(this->found_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"found_call_messages_\":"); output.emplace_back(std::to_string(this->found_call_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"found_fts_messages_\":"); output.emplace_back(std::to_string(this->found_fts_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"get_dialog_queries_\":"); output.emplace_back(std::to_string(this->get_dialog_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"get_dialog_query_log_event_id_\":"); output.emplace_back(std::to_string(this->get_dialog_query_log_event_id_.size()));
output.emplace_back(",");
output.emplace_back("\"replied_by_yet_unsent_messages_\":"); output.emplace_back(std::to_string(this->replied_by_yet_unsent_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"replied_yet_unsent_messages_\":"); output.emplace_back(std::to_string(this->replied_yet_unsent_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"message_to_replied_media_timestamp_messages_\":"); output.emplace_back(std::to_string(this->message_to_replied_media_timestamp_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"story_to_replied_media_timestamp_messages_\":"); output.emplace_back(std::to_string(this->story_to_replied_media_timestamp_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"notification_group_id_to_dialog_id_\":"); output.emplace_back(std::to_string(this->notification_group_id_to_dialog_id_.size()));
output.emplace_back(",");
output.emplace_back("\"active_get_channel_differences_\":"); output.emplace_back(std::to_string(this->active_get_channel_differences_.size()));
output.emplace_back(",");
output.emplace_back("\"get_channel_difference_to_log_event_id_\":"); output.emplace_back(std::to_string(this->get_channel_difference_to_log_event_id_.size()));
output.emplace_back(",");
output.emplace_back("\"channel_get_difference_retry_timeouts_\":"); output.emplace_back(std::to_string(this->channel_get_difference_retry_timeouts_.size()));
output.emplace_back(",");
output.emplace_back("\"postponed_channel_updates_\":"); output.emplace_back(std::to_string(this->postponed_channel_updates_.size()));
output.emplace_back(",");
output.emplace_back("\"is_channel_difference_finished_\":"); output.emplace_back(std::to_string(this->is_channel_difference_finished_.size()));
output.emplace_back(",");
output.emplace_back("\"expected_channel_pts_\":"); output.emplace_back(std::to_string(this->expected_channel_pts_.size()));
output.emplace_back(",");
output.emplace_back("\"expected_channel_max_message_id_\":"); output.emplace_back(std::to_string(this->expected_channel_max_message_id_.size()));
output.emplace_back(",");
output.emplace_back("\"active_live_location_message_full_ids_\":"); output.emplace_back(std::to_string(this->active_live_location_message_full_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"load_active_live_location_messages_queries_\":"); output.emplace_back(std::to_string(this->load_active_live_location_messages_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"load_scheduled_messages_from_database_queries_\":"); output.emplace_back(std::to_string(this->load_scheduled_messages_from_database_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"get_dialogs_tasks_\":"); output.emplace_back(std::to_string(this->get_dialogs_tasks_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_on_get_dialogs_\":"); output.emplace_back(std::to_string(this->pending_on_get_dialogs_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_channel_on_get_dialogs_\":"); output.emplace_back(std::to_string(this->pending_channel_on_get_dialogs_.size()));
output.emplace_back(",");
output.emplace_back("\"run_after_get_channel_difference_\":"); output.emplace_back(std::to_string(this->run_after_get_channel_difference_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_secret_message_ids_\":"); output.emplace_back(std::to_string(this->pending_secret_message_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_add_dialog_dependent_dialogs_\":"); output.emplace_back(std::to_string(this->pending_add_dialog_dependent_dialogs_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_add_dialog_data_\":"); output.emplace_back(std::to_string(this->pending_add_dialog_data_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_add_default_join_group_call_as_dialog_id_\":"); output.emplace_back(std::to_string(this->pending_add_default_join_group_call_as_dialog_id_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_add_default_send_message_as_dialog_id_\":"); output.emplace_back(std::to_string(this->pending_add_default_send_message_as_dialog_id_.size()));
output.emplace_back(",");
output.emplace_back("\"dialog_bot_command_message_ids_\":"); output.emplace_back(std::to_string(this->dialog_bot_command_message_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"viewed_live_location_tasks_\":"); output.emplace_back(std::to_string(this->viewed_live_location_tasks_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_viewed_live_locations_\":"); output.emplace_back(std::to_string(this->pending_viewed_live_locations_.size()));
output.emplace_back(",");
output.emplace_back("\"yet_unsent_media_queues_\":"); output.emplace_back(std::to_string(this->yet_unsent_media_queues_.size()));
output.emplace_back(",");
output.emplace_back("\"message_full_id_to_file_source_id_\":"); output.emplace_back(std::to_string(this->message_full_id_to_file_source_id_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"last_outgoing_forwarded_message_date_\":"); output.emplace_back(std::to_string(this->last_outgoing_forwarded_message_date_.size()));
output.emplace_back(",");
output.emplace_back("\"dialog_viewed_messages_\":"); output.emplace_back(std::to_string(this->dialog_viewed_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"being_reloaded_reactions_\":"); output.emplace_back(std::to_string(this->being_reloaded_reactions_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_dialog_group_call_updates_\":"); output.emplace_back(std::to_string(this->pending_dialog_group_call_updates_.size()));
output.emplace_back(",");
output.emplace_back("\"auth_notification_id_date_\":"); output.emplace_back(std::to_string(this->auth_notification_id_date_.size()));
output.emplace_back(",");
output.emplace_back("\"previous_repaired_read_inbox_max_message_id_\":"); output.emplace_back(std::to_string(this->previous_repaired_read_inbox_max_message_id_.size()));
output.emplace_back(",");
output.emplace_back("\"yet_unsent_message_full_id_to_persistent_message_id_\":"); output.emplace_back(std::to_string(this->yet_unsent_message_full_id_to_persistent_message_id_.size()));
output.emplace_back(",");
output.emplace_back("\"yet_unsent_thread_message_ids_\":"); output.emplace_back(std::to_string(this->yet_unsent_thread_message_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"dialog_suffix_load_queries_\":"); output.emplace_back(std::to_string(this->dialog_suffix_load_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_message_views_\":"); output.emplace_back(std::to_string(this->pending_message_views_.size()));
output.emplace_back(",");
output.emplace_back("\"read_history_log_event_ids_\":"); output.emplace_back(std::to_string(this->read_history_log_event_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"updated_read_history_message_ids_\":"); output.emplace_back(std::to_string(this->updated_read_history_message_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_reactions_\":"); output.emplace_back(std::to_string(this->pending_reactions_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_read_reactions_\":"); output.emplace_back(std::to_string(this->pending_read_reactions_.size()));
output.emplace_back(",");
output.emplace_back("\"active_reaction_types_\":"); output.emplace_back(std::to_string(this->active_reaction_types_.size()));
output.emplace_back(",");
output.emplace_back("\"active_reaction_pos_\":"); output.emplace_back(std::to_string(this->active_reaction_pos_.size()));
output.emplace_back(",");
output.emplace_back("\"get_history_queries_\":"); output.emplace_back(std::to_string(this->get_history_queries_.size()));
}
} // namespace td

View File

@ -118,6 +118,7 @@ class Usernames;
class MessagesManager final : public Actor {
public:
void memory_stats(vector<string> &output);
static constexpr int32 SEND_MESSAGE_FLAG_DISABLE_WEB_PAGE_PREVIEW = 1 << 1;
static constexpr int32 SEND_MESSAGE_FLAG_HAS_REPLY_MARKUP = 1 << 2;
static constexpr int32 SEND_MESSAGE_FLAG_HAS_ENTITIES = 1 << 3;
@ -143,8 +144,6 @@ class MessagesManager final : public Actor {
static bool is_invalid_poll_message(const telegram_api::Message *message);
void memory_stats(vector<string> &output);
static int32 get_message_date(const tl_object_ptr<telegram_api::Message> &message_ptr);
void on_get_empty_messages(DialogId dialog_id, const vector<MessageId> &empty_message_ids);

View File

@ -4371,4 +4371,32 @@ void NotificationManager::on_binlog_events(vector<BinlogEvent> &&events) {
VLOG(notifications) << "Finish processing binlog events";
}
void NotificationManager::memory_stats(vector<string> &output) {
output.emplace_back("\"running_get_chat_difference_\":"); output.emplace_back(std::to_string(this->running_get_chat_difference_.size()));
output.emplace_back(",");
output.emplace_back("\"group_keys_\":"); output.emplace_back(std::to_string(this->group_keys_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_updates_\":"); output.emplace_back(std::to_string(this->pending_updates_.size()));
output.emplace_back(",");
output.emplace_back("\"call_notification_group_ids_\":"); output.emplace_back(std::to_string(this->call_notification_group_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"available_call_notification_group_ids_\":"); output.emplace_back(std::to_string(this->available_call_notification_group_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"dialog_id_to_call_notification_group_id_\":"); output.emplace_back(std::to_string(this->dialog_id_to_call_notification_group_id_.size()));
output.emplace_back(",");
output.emplace_back("\"temporary_notification_log_event_ids_\":"); output.emplace_back(std::to_string(this->temporary_notification_log_event_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"temporary_edit_notification_log_event_ids_\":"); output.emplace_back(std::to_string(this->temporary_edit_notification_log_event_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"temporary_notifications_\":"); output.emplace_back(std::to_string(this->temporary_notifications_.size()));
output.emplace_back(",");
output.emplace_back("\"temporary_notification_object_ids_\":"); output.emplace_back(std::to_string(this->temporary_notification_object_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"push_notification_promises_\":"); output.emplace_back(std::to_string(this->push_notification_promises_.size()));
output.emplace_back(",");
output.emplace_back("\"active_call_notifications_\":"); output.emplace_back(std::to_string(this->active_call_notifications_.size()));
output.emplace_back(",");
output.emplace_back("\"announcement_id_date_\":"); output.emplace_back(std::to_string(this->announcement_id_date_.size()));
}
} // namespace td

View File

@ -48,6 +48,7 @@ class Td;
class NotificationManager final : public Actor {
public:
void memory_stats(vector<string> &output);
static constexpr int32 MIN_NOTIFICATION_GROUP_COUNT_MAX = 0;
static constexpr int32 MAX_NOTIFICATION_GROUP_COUNT_MAX = 25;
static constexpr int32 MIN_NOTIFICATION_GROUP_SIZE_MAX = 1;

View File

@ -1572,4 +1572,18 @@ void NotificationSettingsManager::get_current_state(vector<td_api::object_ptr<td
}
}
void NotificationSettingsManager::memory_stats(vector<string> &output) {
output.emplace_back("\"saved_ringtone_file_ids_\":"); output.emplace_back(std::to_string(this->saved_ringtone_file_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"sorted_saved_ringtone_file_ids_\":"); output.emplace_back(std::to_string(this->sorted_saved_ringtone_file_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"being_uploaded_ringtones_\":"); output.emplace_back(std::to_string(this->being_uploaded_ringtones_.size()));
output.emplace_back(",");
output.emplace_back("\"reload_saved_ringtones_queries_\":"); output.emplace_back(std::to_string(this->reload_saved_ringtones_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"repair_saved_ringtones_queries_\":"); output.emplace_back(std::to_string(this->repair_saved_ringtones_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"get_dialog_notification_settings_queries_\":"); output.emplace_back(std::to_string(this->get_dialog_notification_settings_queries_.size()));
}
} // namespace td

View File

@ -38,6 +38,7 @@ class Td;
class NotificationSettingsManager final : public Actor {
public:
void memory_stats(vector<string> &output);
NotificationSettingsManager(Td *td, ActorShared<> parent);
NotificationSettingsManager(const NotificationSettingsManager &) = delete;
NotificationSettingsManager &operator=(const NotificationSettingsManager &) = delete;

View File

@ -1062,4 +1062,8 @@ void OptionManager::get_current_state(vector<td_api::object_ptr<td_api::Update>>
}
}
void OptionManager::memory_stats(vector<string> &output) {
output.emplace_back("\"pending_get_options_\":"); output.emplace_back(std::to_string(this->pending_get_options_.size()));
}
} // namespace td

View File

@ -24,6 +24,7 @@ class TsSeqKeyValue;
class OptionManager {
public:
void memory_stats(vector<string> &output);
explicit OptionManager(Td *td);
OptionManager(const OptionManager &) = delete;
OptionManager &operator=(const OptionManager &) = delete;

View File

@ -446,4 +446,12 @@ void PeopleNearbyManager::update_is_location_visible() {
td_->option_manager_->set_option_boolean("is_location_visible", expire_date != 0);
}
void PeopleNearbyManager::memory_stats(vector<string> &output) {
output.emplace_back("\"users_nearby_\":"); output.emplace_back(std::to_string(this->users_nearby_.size()));
output.emplace_back(",");
output.emplace_back("\"channels_nearby_\":"); output.emplace_back(std::to_string(this->channels_nearby_.size()));
output.emplace_back(",");
output.emplace_back("\"all_users_nearby_\":"); output.emplace_back(std::to_string(this->all_users_nearby_.size()));
}
} // namespace td

View File

@ -26,6 +26,7 @@ class Td;
class PeopleNearbyManager final : public Actor {
public:
void memory_stats(vector<string> &output);
PeopleNearbyManager(Td *td, ActorShared<> parent);
void search_dialogs_nearby(const Location &location, Promise<td_api::object_ptr<td_api::chatsNearby>> &&promise);

View File

@ -1970,15 +1970,21 @@ void PollManager::on_binlog_events(vector<BinlogEvent> &&events) {
}
void PollManager::memory_stats(vector<string> &output) {
output.push_back("\"polls_\":"); output.push_back(std::to_string(polls_.calc_size()));
output.push_back(",");
output.push_back("\"pending_answers_\":"); output.push_back(std::to_string(pending_answers_.size()));
output.push_back(",");
output.push_back("\"poll_voters_\":"); output.push_back(std::to_string(poll_voters_.size()));
output.push_back(",");
output.push_back("\"loaded_from_database_polls_\":"); output.push_back(std::to_string(loaded_from_database_polls_.size()));
output.push_back(",");
output.push_back("\"being_closed_polls_\":"); output.push_back(std::to_string(being_closed_polls_.size()));
output.emplace_back("\"polls_\":"); output.emplace_back(std::to_string(this->polls_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"server_poll_messages_\":"); output.emplace_back(std::to_string(this->server_poll_messages_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"other_poll_messages_\":"); output.emplace_back(std::to_string(this->other_poll_messages_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"reply_poll_counts_\":"); output.emplace_back(std::to_string(this->reply_poll_counts_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"pending_answers_\":"); output.emplace_back(std::to_string(this->pending_answers_.size()));
output.emplace_back(",");
output.emplace_back("\"poll_voters_\":"); output.emplace_back(std::to_string(this->poll_voters_.size()));
output.emplace_back(",");
output.emplace_back("\"loaded_from_database_polls_\":"); output.emplace_back(std::to_string(this->loaded_from_database_polls_.size()));
output.emplace_back(",");
output.emplace_back("\"being_closed_polls_\":"); output.emplace_back(std::to_string(this->being_closed_polls_.size()));
}
} // namespace td

View File

@ -39,6 +39,7 @@ class Td;
class PollManager final : public Actor {
public:
void memory_stats(vector<string> &output);
PollManager(Td *td, ActorShared<> parent);
PollManager(const PollManager &) = delete;
@ -47,8 +48,6 @@ class PollManager final : public Actor {
PollManager &operator=(PollManager &&) = delete;
~PollManager() final;
void memory_stats(vector<string> &output);
static bool is_local_poll_id(PollId poll_id);
PollId create_poll(string &&question, vector<string> &&options, bool is_anonymous, bool allow_multiple_answers,

View File

@ -245,4 +245,7 @@ void PrivacyManager::do_update_privacy(UserPrivacySetting user_privacy_setting,
}
}
void PrivacyManager::memory_stats(vector<string> &output) {
}
} // namespace td

View File

@ -25,6 +25,7 @@ class Td;
class PrivacyManager final : public Actor {
public:
void memory_stats(vector<string> &output);
PrivacyManager(Td *td, ActorShared<> parent);
void get_privacy(tl_object_ptr<td_api::UserPrivacySetting> key,

View File

@ -1793,4 +1793,14 @@ void QuickReplyManager::get_current_state(vector<td_api::object_ptr<td_api::Upda
}
}
void QuickReplyManager::memory_stats(vector<string> &output) {
output.emplace_back("\"deleted_shortcut_ids_\":"); output.emplace_back(std::to_string(this->deleted_shortcut_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"get_shortcut_messages_queries_\":"); output.emplace_back(std::to_string(this->get_shortcut_messages_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"deleted_message_full_ids_\":"); output.emplace_back(std::to_string(this->deleted_message_full_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"message_full_id_to_file_source_id_\":"); output.emplace_back(std::to_string(this->message_full_id_to_file_source_id_.size()));
}
} // namespace td

View File

@ -36,6 +36,7 @@ class Td;
class QuickReplyManager final : public Actor {
public:
void memory_stats(vector<string> &output);
QuickReplyManager(Td *td, ActorShared<> parent);
static Status check_shortcut_name(CSlice name);

View File

@ -1184,4 +1184,14 @@ void ReactionManager::get_current_state(vector<td_api::object_ptr<td_api::Update
}
}
void ReactionManager::memory_stats(vector<string> &output) {
output.emplace_back("\"pending_get_emoji_reaction_queries_\":"); output.emplace_back(std::to_string(this->pending_get_emoji_reaction_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"active_reaction_types_\":"); output.emplace_back(std::to_string(this->active_reaction_types_.size()));
output.emplace_back(",");
output.emplace_back("\"topic_tags_\":"); output.emplace_back(std::to_string(this->topic_tags_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_all_saved_reaction_tags_queries_\":"); output.emplace_back(std::to_string(this->pending_get_all_saved_reaction_tags_queries_.size()));
}
} // namespace td

View File

@ -31,6 +31,7 @@ class Td;
class ReactionManager final : public Actor {
public:
void memory_stats(vector<string> &output);
ReactionManager(Td *td, ActorShared<> parent);
ReactionManager(const ReactionManager &) = delete;
ReactionManager &operator=(const ReactionManager &) = delete;

View File

@ -1049,4 +1049,8 @@ const SavedMessagesManager::TopicDate SavedMessagesManager::MIN_TOPIC_DATE{std::
SavedMessagesTopicId()};
const SavedMessagesManager::TopicDate SavedMessagesManager::MAX_TOPIC_DATE{0, SavedMessagesTopicId()};
void SavedMessagesManager::memory_stats(vector<string> &output) {
output.emplace_back("\"saved_messages_topics_\":"); output.emplace_back(std::to_string(this->saved_messages_topics_.size()));
}
} // namespace td

View File

@ -29,6 +29,7 @@ class Td;
class SavedMessagesManager final : public Actor {
public:
void memory_stats(vector<string> &output);
SavedMessagesManager(Td *td, ActorShared<> parent);
SavedMessagesTopicId get_topic_id(int64 topic_id) const;

View File

@ -511,4 +511,8 @@ void SponsoredMessageManager::click_sponsored_message(DialogId dialog_id, Messag
->send(dialog_id.get_channel_id(), random_id_it->second.random_id_);
}
void SponsoredMessageManager::memory_stats(vector<string> &output) {
output.emplace_back("\"dialog_sponsored_messages_\":"); output.emplace_back(std::to_string(this->dialog_sponsored_messages_.size()));
}
} // namespace td

View File

@ -25,6 +25,7 @@ class Td;
class SponsoredMessageManager final : public Actor {
public:
void memory_stats(vector<string> &output);
SponsoredMessageManager(Td *td, ActorShared<> parent);
SponsoredMessageManager(const SponsoredMessageManager &) = delete;
SponsoredMessageManager &operator=(const SponsoredMessageManager &) = delete;

View File

@ -738,4 +738,7 @@ void StatisticsManager::get_channel_differences_if_needed(
source);
}
void StatisticsManager::memory_stats(vector<string> &output) {
}
} // namespace td

View File

@ -25,6 +25,7 @@ class Td;
class StatisticsManager final : public Actor {
public:
void memory_stats(vector<string> &output);
StatisticsManager(Td *td, ActorShared<> parent);
void get_channel_statistics(DialogId dialog_id, bool is_dark,

View File

@ -10150,27 +10150,87 @@ void StickersManager::get_current_state(vector<td_api::object_ptr<td_api::Update
}
void StickersManager::memory_stats(vector<string> &output) {
output.push_back("\"archived_sticker_set_ids_\":"); output.push_back(std::to_string(archived_sticker_set_ids_->size()));
output.push_back(",");
output.push_back("\"attached_sticker_sets_\":"); output.push_back(std::to_string(attached_sticker_sets_.size()));
output.push_back(",");
output.push_back("\"favorite_sticker_file_ids_\":"); output.push_back(std::to_string(favorite_sticker_file_ids_.size()));
output.push_back(",");
output.push_back("\"favorite_sticker_ids_\":"); output.push_back(std::to_string(favorite_sticker_ids_.size()));
output.push_back(",");
output.push_back("\"installed_sticker_set_ids_\":"); output.push_back(std::to_string(installed_sticker_set_ids_->size()));
output.push_back(",");
output.push_back("\"recent_sticker_file_ids_\":"); output.push_back(std::to_string(recent_sticker_file_ids_->size()));
output.push_back(",");
output.push_back("\"recent_sticker_ids_\":"); output.push_back(std::to_string(recent_sticker_ids_->size()));
output.push_back(",");
output.push_back("\"short_name_to_sticker_set_id_\":"); output.push_back(std::to_string(short_name_to_sticker_set_id_.calc_size()));
output.push_back(",");
output.push_back("\"special_sticker_sets_\":"); output.push_back(std::to_string(special_sticker_sets_.size()));
output.push_back(",");
output.push_back("\"sticker_sets_\":"); output.push_back(std::to_string(sticker_sets_.calc_size()));
output.push_back(",");
output.push_back("\"stickers_\":"); output.push_back(std::to_string(stickers_.calc_size()));
output.emplace_back("\"stickers_\":"); output.emplace_back(std::to_string(this->stickers_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"sticker_sets_\":"); output.emplace_back(std::to_string(this->sticker_sets_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"short_name_to_sticker_set_id_\":"); output.emplace_back(std::to_string(this->short_name_to_sticker_set_id_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"favorite_sticker_ids_\":"); output.emplace_back(std::to_string(this->favorite_sticker_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"load_old_featured_sticker_sets_queries_\":"); output.emplace_back(std::to_string(this->load_old_featured_sticker_sets_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"load_favorite_stickers_queries_\":"); output.emplace_back(std::to_string(this->load_favorite_stickers_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"repair_favorite_stickers_queries_\":"); output.emplace_back(std::to_string(this->repair_favorite_stickers_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"sticker_set_reload_queries_\":"); output.emplace_back(std::to_string(this->sticker_set_reload_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"favorite_sticker_file_ids_\":"); output.emplace_back(std::to_string(this->favorite_sticker_file_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"attached_sticker_sets_\":"); output.emplace_back(std::to_string(this->attached_sticker_sets_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_viewed_featured_sticker_set_ids_\":"); output.emplace_back(std::to_string(this->pending_viewed_featured_sticker_set_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"special_sticker_sets_\":"); output.emplace_back(std::to_string(this->special_sticker_sets_.size()));
output.emplace_back(",");
output.emplace_back("\"sticker_set_load_requests_\":"); output.emplace_back(std::to_string(this->sticker_set_load_requests_.size()));
output.emplace_back(",");
output.emplace_back("\"custom_emoji_load_queries_\":"); output.emplace_back(std::to_string(this->custom_emoji_load_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_new_sticker_sets_\":"); output.emplace_back(std::to_string(this->pending_new_sticker_sets_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_add_sticker_to_sets_\":"); output.emplace_back(std::to_string(this->pending_add_sticker_to_sets_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_set_sticker_set_thumbnails_\":"); output.emplace_back(std::to_string(this->pending_set_sticker_set_thumbnails_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_animated_emoji_queries_\":"); output.emplace_back(std::to_string(this->pending_get_animated_emoji_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_premium_gift_option_sticker_queries_\":"); output.emplace_back(std::to_string(this->pending_get_premium_gift_option_sticker_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_generic_animations_queries_\":"); output.emplace_back(std::to_string(this->pending_get_generic_animations_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_default_statuses_queries_\":"); output.emplace_back(std::to_string(this->pending_get_default_statuses_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_default_channel_statuses_queries_\":"); output.emplace_back(std::to_string(this->pending_get_default_channel_statuses_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_default_topic_icons_queries_\":"); output.emplace_back(std::to_string(this->pending_get_default_topic_icons_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_get_animated_emoji_click_stickers_\":"); output.emplace_back(std::to_string(this->pending_get_animated_emoji_click_stickers_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_on_animated_emoji_message_clicked_\":"); output.emplace_back(std::to_string(this->pending_on_animated_emoji_message_clicked_.size()));
output.emplace_back(",");
output.emplace_back("\"being_uploaded_files_\":"); output.emplace_back(std::to_string(this->being_uploaded_files_.size()));
output.emplace_back(",");
output.emplace_back("\"emoji_language_codes_\":"); output.emplace_back(std::to_string(this->emoji_language_codes_.size()));
output.emplace_back(",");
output.emplace_back("\"emoji_language_code_versions_\":"); output.emplace_back(std::to_string(this->emoji_language_code_versions_.size()));
output.emplace_back(",");
output.emplace_back("\"emoji_language_code_last_difference_times_\":"); output.emplace_back(std::to_string(this->emoji_language_code_last_difference_times_.size()));
output.emplace_back(",");
output.emplace_back("\"reloaded_emoji_keywords_\":"); output.emplace_back(std::to_string(this->reloaded_emoji_keywords_.size()));
output.emplace_back(",");
output.emplace_back("\"load_emoji_keywords_queries_\":"); output.emplace_back(std::to_string(this->load_emoji_keywords_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"load_language_codes_queries_\":"); output.emplace_back(std::to_string(this->load_language_codes_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"emoji_suggestions_urls_\":"); output.emplace_back(std::to_string(this->emoji_suggestions_urls_.size()));
output.emplace_back(",");
output.emplace_back("\"premium_gift_messages_\":"); output.emplace_back(std::to_string(this->premium_gift_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"dice_messages_\":"); output.emplace_back(std::to_string(this->dice_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"emoji_messages_\":"); output.emplace_back(std::to_string(this->emoji_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"custom_emoji_messages_\":"); output.emplace_back(std::to_string(this->custom_emoji_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"dice_emojis_\":"); output.emplace_back(std::to_string(this->dice_emojis_.size()));
output.emplace_back(",");
output.emplace_back("\"dice_success_values_\":"); output.emplace_back(std::to_string(this->dice_success_values_.size()));
output.emplace_back(",");
output.emplace_back("\"emoji_sounds_\":"); output.emplace_back(std::to_string(this->emoji_sounds_.size()));
output.emplace_back(",");
output.emplace_back("\"custom_emoji_to_sticker_id_\":"); output.emplace_back(std::to_string(this->custom_emoji_to_sticker_id_.calc_size()));
}
} // namespace td

View File

@ -55,9 +55,8 @@ class Td;
class StickersManager final : public Actor {
public:
static constexpr int64 GREAT_MINDS_SET_ID = 1842540969984001;
void memory_stats(vector<string> &output);
static constexpr int64 GREAT_MINDS_SET_ID = 1842540969984001;
static vector<StickerSetId> convert_sticker_set_ids(const vector<int64> &sticker_set_ids);
static vector<int64> convert_sticker_set_ids(const vector<StickerSetId> &sticker_set_ids);

View File

@ -5702,4 +5702,70 @@ void StoryManager::on_binlog_events(vector<BinlogEvent> &&events) {
}
}
void StoryManager::memory_stats(vector<string> &output) {
output.emplace_back("\"story_full_id_to_file_source_id_\":"); output.emplace_back(std::to_string(this->story_full_id_to_file_source_id_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"stories_\":"); output.emplace_back(std::to_string(this->stories_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"stories_by_global_id_\":"); output.emplace_back(std::to_string(this->stories_by_global_id_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"inaccessible_story_full_ids_\":"); output.emplace_back(std::to_string(this->inaccessible_story_full_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"deleted_story_full_ids_\":"); output.emplace_back(std::to_string(this->deleted_story_full_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"failed_to_load_story_full_ids_\":"); output.emplace_back(std::to_string(this->failed_to_load_story_full_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"story_messages_\":"); output.emplace_back(std::to_string(this->story_messages_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"active_stories_\":"); output.emplace_back(std::to_string(this->active_stories_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"updated_active_stories_\":"); output.emplace_back(std::to_string(this->updated_active_stories_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"max_read_story_ids_\":"); output.emplace_back(std::to_string(this->max_read_story_ids_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"failed_to_load_active_stories_\":"); output.emplace_back(std::to_string(this->failed_to_load_active_stories_.calc_size()));
output.emplace_back(",");
output.emplace_back("\"load_expiring_stories_log_event_ids_\":"); output.emplace_back(std::to_string(this->load_expiring_stories_log_event_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"being_edited_stories_\":"); output.emplace_back(std::to_string(this->being_edited_stories_.size()));
output.emplace_back(",");
output.emplace_back("\"edit_generations_\":"); output.emplace_back(std::to_string(this->edit_generations_.size()));
output.emplace_back(",");
output.emplace_back("\"pending_story_views_\":"); output.emplace_back(std::to_string(this->pending_story_views_.size()));
output.emplace_back(",");
output.emplace_back("\"opened_stories_with_view_count_\":"); output.emplace_back(std::to_string(this->opened_stories_with_view_count_.size()));
output.emplace_back(",");
output.emplace_back("\"opened_stories_\":"); output.emplace_back(std::to_string(this->opened_stories_.size()));
output.emplace_back(",");
output.emplace_back("\"reload_story_queries_\":"); output.emplace_back(std::to_string(this->reload_story_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"being_uploaded_files_\":"); output.emplace_back(std::to_string(this->being_uploaded_files_.size()));
output.emplace_back(",");
output.emplace_back("\"yet_unsent_stories_\":"); output.emplace_back(std::to_string(this->yet_unsent_stories_.size()));
output.emplace_back(",");
output.emplace_back("\"yet_unsent_story_ids_\":"); output.emplace_back(std::to_string(this->yet_unsent_story_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"being_sent_stories_\":"); output.emplace_back(std::to_string(this->being_sent_stories_.size()));
output.emplace_back(",");
output.emplace_back("\"being_sent_story_random_ids_\":"); output.emplace_back(std::to_string(this->being_sent_story_random_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"being_uploaded_file_ids_\":"); output.emplace_back(std::to_string(this->being_uploaded_file_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"update_story_ids_\":"); output.emplace_back(std::to_string(this->update_story_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"delete_yet_unsent_story_queries_\":"); output.emplace_back(std::to_string(this->delete_yet_unsent_story_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"ready_to_send_stories_\":"); output.emplace_back(std::to_string(this->ready_to_send_stories_.size()));
output.emplace_back(",");
output.emplace_back("\"being_reloaded_active_stories_dialog_ids_\":"); output.emplace_back(std::to_string(this->being_reloaded_active_stories_dialog_ids_.size()));
output.emplace_back(",");
output.emplace_back("\"channels_to_send_stories_\":"); output.emplace_back(std::to_string(this->channels_to_send_stories_.size()));
output.emplace_back(",");
output.emplace_back("\"get_dialogs_to_send_stories_queries_\":"); output.emplace_back(std::to_string(this->get_dialogs_to_send_stories_queries_.size()));
output.emplace_back(",");
output.emplace_back("\"being_set_story_reactions_\":"); output.emplace_back(std::to_string(this->being_set_story_reactions_.size()));
output.emplace_back(",");
output.emplace_back("\"current_yet_unsent_story_ids_\":"); output.emplace_back(std::to_string(this->current_yet_unsent_story_ids_.size()));
}
} // namespace td

View File

@ -193,6 +193,7 @@ class StoryManager final : public Actor {
};
public:
void memory_stats(vector<string> &output);
StoryManager(Td *td, ActorShared<> parent);
StoryManager(const StoryManager &) = delete;
StoryManager &operator=(const StoryManager &) = delete;

View File

@ -1130,4 +1130,7 @@ void ThemeManager::get_current_state(vector<td_api::object_ptr<td_api::Update>>
}
}
void ThemeManager::memory_stats(vector<string> &output) {
}
} // namespace td

View File

@ -24,6 +24,7 @@ class Td;
class ThemeManager final : public Actor {
public:
void memory_stats(vector<string> &output);
ThemeManager(Td *td, ActorShared<> parent);
void init();

View File

@ -192,4 +192,8 @@ void TimeZoneManager::save_time_zones() {
G()->td_db()->get_binlog_pmc()->set(get_time_zones_database_key(), log_event_store(time_zones_).as_slice().str());
}
void TimeZoneManager::memory_stats(vector<string> &output) {
output.emplace_back("\"get_time_zones_queries_\":"); output.emplace_back(std::to_string(this->get_time_zones_queries_.size()));
}
} // namespace td

View File

@ -21,6 +21,7 @@ class Td;
class TimeZoneManager final : public Actor {
public:
void memory_stats(vector<string> &output);
TimeZoneManager(Td *td, ActorShared<> parent);
TimeZoneManager(const TimeZoneManager &) = delete;
TimeZoneManager &operator=(const TimeZoneManager &) = delete;

View File

@ -679,4 +679,8 @@ void TopDialogManager::loop() {
}
}
void TopDialogManager::memory_stats(vector<string> &output) {
output.emplace_back("\"pending_get_top_dialogs_\":"); output.emplace_back(std::to_string(this->pending_get_top_dialogs_.size()));
}
} // namespace td

View File

@ -27,6 +27,7 @@ class Td;
class TopDialogManager final : public Actor {
public:
void memory_stats(vector<string> &output);
TopDialogManager(Td *td, ActorShared<> parent);
void init();

View File

@ -441,4 +441,12 @@ void TranscriptionManager::get_current_state(vector<td_api::object_ptr<td_api::U
updates.push_back(get_update_speech_recognition_trial_object());
}
void TranscriptionManager::memory_stats(vector<string> &output) {
output.emplace_back("\"pending_audio_transcriptions_\":"); output.emplace_back(std::to_string(this->pending_audio_transcriptions_.size()));
output.emplace_back(",");
output.emplace_back("\"voice_messages_\":"); output.emplace_back(std::to_string(this->voice_messages_.size()));
output.emplace_back(",");
output.emplace_back("\"message_file_ids_\":"); output.emplace_back(std::to_string(this->message_file_ids_.size()));
}
} // namespace td

View File

@ -32,6 +32,7 @@ class Td;
class TranscriptionManager final : public Actor {
public:
void memory_stats(vector<string> &output);
TranscriptionManager(Td *td, ActorShared<> parent);
TranscriptionManager(const TranscriptionManager &) = delete;
TranscriptionManager &operator=(const TranscriptionManager &) = delete;

View File

@ -126,4 +126,7 @@ void TranslationManager::on_get_translated_texts(vector<telegram_api::object_ptr
promise.set_value(get_formatted_text_object(formatted_text, skip_bot_commands, max_media_timestamp));
}
void TranslationManager::memory_stats(vector<string> &output) {
}
} // namespace td

View File

@ -21,6 +21,7 @@ class Td;
class TranslationManager final : public Actor {
public:
void memory_stats(vector<string> &output);
TranslationManager(Td *td, ActorShared<> parent);
void translate_text(td_api::object_ptr<td_api::formattedText> &&text, const string &to_language_code,

View File

@ -4509,4 +4509,8 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateDeleteQuickRepl
// unsupported updates
void UpdatesManager::memory_stats(vector<string> &output) {
output.emplace_back("\"session_infos_\":"); output.emplace_back(std::to_string(this->session_infos_.size()));
}
} // namespace td

View File

@ -95,6 +95,7 @@ class updateSentMessage final : public telegram_api::Update {
class UpdatesManager final : public Actor {
public:
void memory_stats(vector<string> &output);
UpdatesManager(Td *td, ActorShared<> parent);
void on_get_updates(tl_object_ptr<telegram_api::Updates> &&updates_ptr, Promise<Unit> &&promise);

View File

@ -265,7 +265,7 @@ tl_object_ptr<telegram_api::InputMedia> VideoNotesManager::get_input_media(
}
void VideoNotesManager::memory_stats(vector<string> &output) {
output.push_back("\"video_notes_\":"); output.push_back(std::to_string(video_notes_.calc_size()));
output.emplace_back("\"video_notes_\":"); output.emplace_back(std::to_string(this->video_notes_.calc_size()));
}
} // namespace td

View File

@ -26,6 +26,7 @@ class Td;
class VideoNotesManager final : public Actor {
public:
void memory_stats(vector<string> &output);
VideoNotesManager(Td *td, ActorShared<> parent);
VideoNotesManager(const VideoNotesManager &) = delete;
VideoNotesManager &operator=(const VideoNotesManager &) = delete;
@ -33,8 +34,6 @@ class VideoNotesManager final : public Actor {
VideoNotesManager &operator=(VideoNotesManager &&) = delete;
~VideoNotesManager() final;
void memory_stats(vector<string> &output);
int32 get_video_note_duration(FileId file_id) const;
TranscriptionInfo *get_video_note_transcription_info(FileId file_id, bool allow_creation);

Some files were not shown because too many files have changed in this diff Show More