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/common | |
| 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/common')
| -rw-r--r-- | src/common/Metric/Metric.cpp | 2 | ||||
| -rw-r--r-- | src/common/Metric/Metric.h | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp index 07db8e83f4d..d22839e8a79 100644 --- a/src/common/Metric/Metric.cpp +++ b/src/common/Metric/Metric.cpp @@ -137,7 +137,7 @@ void Metric::SendBatch() batchedData << ",realm=" << _realmName; for (MetricTag const& tag : data->Tags) - batchedData << "," << tag.first << "=" << tag.second; + batchedData << "," << tag.first << "=" << FormatInfluxDBTagValue(tag.second); batchedData << " "; diff --git a/src/common/Metric/Metric.h b/src/common/Metric/Metric.h index 5038338421c..33bdf3b4ed7 100644 --- a/src/common/Metric/Metric.h +++ b/src/common/Metric/Metric.h @@ -158,10 +158,16 @@ MetricStopWatch<LoggerType> MakeMetricStopWatch(LoggerType&& loggerFunc) #define TC_METRIC_TAG(name, value) { name, value } -#ifdef PERFORMANCE_PROFILING +#define TC_METRIC_DO_CONCAT(a, b) a##b +#define TC_METRIC_CONCAT(a, b) TC_METRIC_DO_CONCAT(a, b) +#define TC_METRIC_UNIQUE_NAME(name) TC_METRIC_CONCAT(name, __LINE__) + +#if defined PERFORMANCE_PROFILING || defined WITHOUT_METRICS #define TC_METRIC_EVENT(category, title, description) ((void)0) #define TC_METRIC_VALUE(category, value) ((void)0) -#elif TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS +#define TC_METRIC_TIMER(category, ...) ((void)0) +#else +# if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS #define TC_METRIC_EVENT(category, title, description) \ do { \ if (sMetric->IsEnabled()) \ @@ -172,7 +178,7 @@ MetricStopWatch<LoggerType> MakeMetricStopWatch(LoggerType&& loggerFunc) if (sMetric->IsEnabled()) \ sMetric->LogValue(category, value, { __VA_ARGS__ }); \ } while (0) -#else +# else #define TC_METRIC_EVENT(category, title, description) \ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ @@ -189,11 +195,12 @@ MetricStopWatch<LoggerType> MakeMetricStopWatch(LoggerType&& loggerFunc) sMetric->LogValue(category, value, { __VA_ARGS__ }); \ } while (0) \ __pragma(warning(pop)) -#endif +# endif #define TC_METRIC_TIMER(category, ...) \ - MetricStopWatch __tc_metric_stop_watch = MakeMetricStopWatch([&](TimePoint start) \ + MetricStopWatch TC_METRIC_UNIQUE_NAME(__tc_metric_stop_watch) = MakeMetricStopWatch([&](TimePoint start) \ { \ sMetric->LogValue(category, std::chrono::steady_clock::now() - start, { __VA_ARGS__ }); \ }); +#endif #endif // METRIC_H__ |
