diff options
author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2020-07-23 22:30:16 +0000 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-23 22:45:25 +0100 |
commit | e8583d04f6a7744bd3576c3241873a8ad33f4f7a (patch) | |
tree | d3071ccdc0705d5fc7a9758e2e50acb117743293 /src/server/game/Time/UpdateTime.cpp | |
parent | 1dfcb7086e17902f0904ee6c09bc55a229b65cc1 (diff) |
Core/Metric: Add more metrics about World::Update() loop (#25098)
* Core/Metric: Add more metrics about World::Update() loop
* Add new Performance profiling grafana dashboard
* Add new cmake setting WITHOUT_METRICS that disables all metrics
As new metrics are added, someone might want to disable them if unused.
* Add more metrics about World::Update() loop
* Remove old performance profiling features
Remove "server set difftime" command, "-RecordUpdateTimeDiffInterval" and "MinRecordUpdateTimeDiff" worldserver config settings and their related code.
The whole UpdateTime class could be removed too.
* Update and rename 2020_07_99_99_world.sql to 2020_07_24_00_world.sql
(cherry picked from commit 3c0ac7302f902d1811d2c215217a3d701f8b5b19)
Diffstat (limited to 'src/server/game/Time/UpdateTime.cpp')
-rw-r--r-- | src/server/game/Time/UpdateTime.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/server/game/Time/UpdateTime.cpp b/src/server/game/Time/UpdateTime.cpp index c4dada2853e..8e72e2c6c75 100644 --- a/src/server/game/Time/UpdateTime.cpp +++ b/src/server/game/Time/UpdateTime.cpp @@ -31,7 +31,6 @@ UpdateTime::UpdateTime() _maxUpdateTime = 0; _maxUpdateTimeOfLastTable = 0; _maxUpdateTimeOfCurrentTable = 0; - _recordedTime = 0; _updateTimeDataTable = { }; } @@ -92,47 +91,3 @@ void UpdateTime::UpdateWithDiff(uint32 diff) else if (_updateTimeTableIndex) _averageUpdateTime = _totalUpdateTime / _updateTimeTableIndex; } - -void UpdateTime::RecordUpdateTimeReset() -{ - _recordedTime = getMSTime(); -} - -void UpdateTime::_RecordUpdateTimeDuration(std::string const& text, uint32 minUpdateTime) -{ - uint32 thisTime = getMSTime(); - uint32 diff = getMSTimeDiff(_recordedTime, thisTime); - - if (diff > minUpdateTime) - TC_LOG_INFO("misc", "Recored Update Time of %s: %u.", text.c_str(), diff); - - _recordedTime = thisTime; -} - -void WorldUpdateTime::LoadFromConfig() -{ - _recordUpdateTimeInverval = sConfigMgr->GetIntDefault("RecordUpdateTimeDiffInterval", 60000); - _recordUpdateTimeMin = sConfigMgr->GetIntDefault("MinRecordUpdateTimeDiff", 100); -} - -void WorldUpdateTime::SetRecordUpdateTimeInterval(uint32 t) -{ - _recordUpdateTimeInverval = t; -} - -void WorldUpdateTime::RecordUpdateTime(uint32 gameTimeMs, uint32 diff, uint32 sessionCount) -{ - if (_recordUpdateTimeInverval > 0 && diff > _recordUpdateTimeMin) - { - if (getMSTimeDiff(_lastRecordTime, gameTimeMs) > _recordUpdateTimeInverval) - { - TC_LOG_DEBUG("misc", "Update time diff: %u. Players online: %u.", GetAverageUpdateTime(), sessionCount); - _lastRecordTime = gameTimeMs; - } - } -} - -void WorldUpdateTime::RecordUpdateTimeDuration(std::string const& text) -{ - _RecordUpdateTimeDuration(text, _recordUpdateTimeMin); -} |