Commit Graph

24 Commits

Author SHA1 Message Date
Shauren
d791afae1d Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) 2023-01-08 21:16:53 +01:00
Shauren
280d83ecc7 Core/Misc: Remove boost::container::small_vector from header files 2023-01-06 16:54:43 +01:00
jackpoz
ce4916ec79 Core/Metric: Sync default Metric.Interval value
Sync default Metric.Interval value in C++ with the value in worldserver.conf

(cherry picked from commit c83d00a645)
2022-06-10 16:57:35 +02:00
Shauren
3e60a92211 Core/Metric: Minor optimizations for metrics (reducing number of allocations)
(cherry picked from commit caaedbfa80)
2022-06-10 16:21:28 +02:00
Shauren
439b027d48 Core/Misc: Cleanup unused includes 2022-02-13 15:07:00 +01:00
Treeston
9f97fdd31a Core/Common: Tokenizer -> Trinity::Tokenize (PR: #25327)
(cherry picked from commit 534a2388b7)
2022-02-04 00:27:14 +01:00
Giacomo Pozzoni
8350985975 Core/Metric: Log detailed metrics about each opcode handler (#25153)
* Core/Metric: Log detailed metrics about each opcode handler

* Add new panel to Performance profiling dashboard and use fill(0) instead of fill(none)

* Add new settings Metric.Threshold.* to be able to specify the minimum threshold for the specified metrics

* Update dashboard

* Change thresholds to be required to send the metrics. A TC_METRIC_DETAILED_TIMER metric with an expected threshold not configured will be ignored

* Use typedef Milliseconds

* Refresh realms on load

(cherry picked from commit 8a2c79c850)
2022-01-24 13:02:38 +01:00
Giacomo Pozzoni
e8583d04f6 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 3c0ac7302f)
2022-01-23 22:45:25 +01:00
Giacomo Pozzoni
8834c5c724 Core/Metric: Log Map::Update() times (#25067)
* Core/Metric: Log Map::Update() times

* Add more performant version to reduce allocations when metrics are disabled

* Linux build fix

* Add metric stopwatch version that doesnt let users forget to _END it

* Fix linux build

* Code cleanup

* Add Map updates panel to General dashboard

* Add "Recent events" panel to General dashboard

* Apply latest codestyle changes

Co-authored-by: Shauren <shauren.trinity@gmail.com>
(cherry picked from commit 5eb742ee6a)
2022-01-23 21:36:28 +01:00
Giacomo Pozzoni
07f42907c6 Log number of Creatures and GameObject per map (#24809)
* Shared/Metric: Allow to specify tags in metrics

* Core/Metric: Log number of Creatures and GameObject per map

* Apply feedback

* Codestyle changes

* Codestyle changes

* Remove whitespace

* Update Grafana dashboards to v7.0.3

* Fix missing filter on realm

* Include Creatures and Gameobjects in Maps dashboard

* Show instances with a different color

(cherry picked from commit 4e1dbd1cf8)
2022-01-06 23:15:07 +01:00
jackpoz
dc2fed13c8 Shared/Metric: Fix a rare memory leak
Fix a memory leak in Metric happening only when enabling/disabling Metric from configs at runtime, leaking the metric added between last SendBatch() call and the ScheduleSend() call in the same function. The only way to reproduce this is to actually freeze the thread calling SendBatch(), disable metric, reload config, unfreeze the thread.

(cherry picked from commit 0d1ff7446d)
2021-12-02 00:39:20 +01:00
jackpoz
8313053a3b Shared/Metric: Fix crash on shutdown
Fix crash on shutdown with metrics enabled but InfluxDB stopping before worldserver

(cherry picked from commit 45b2bcfaf2)
2021-03-15 20:17:31 +01:00
jackpoz
246871e3d5 Shared/Metric: Stop metrics on shutdown
Properly stop metric information gathering and sending on shutdown.
Issue reported by AddressSanitizer.

(cherry picked from commit e9c475d45f)
2021-02-25 18:50:55 +01:00
Shauren
b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
Peter Keresztes Schmidt
bab5fd87a3 Core/Misc: Replace Trinity::make_unique with std (#24869) 2020-06-23 08:54:12 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
bcda8dd742 Core/Dep: Boost 1.70 compatibility 2019-04-14 00:13:23 +02:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren
dfd2660a85 Core/Misc: Added compatibility layer for boost 1.66 and future std:: networking stuff
* Based on work done by @dimiandre in PR #21173

Closes #21171
Closes #21173
2018-01-06 01:21:59 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
3a418a0bbc Core/Common: Include cleanup 2017-05-11 22:29:51 +02:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
jackpoz
f23c6c4d7e Shared/Metric: Initial support for tag value escaping
Fix #18175

(cherry picked from commit 189edc0f23)
2016-11-14 20:33:03 +01:00
DDuarte
8b26aea95a Implement real time statistic visualization (#16956)
Docs at https://trinitycore.atlassian.net/wiki/display/tc/Monitoring+a+TrinityCore+server

* Common/Graphs: Initial proof of concept

* Move influx db code to its own class

* Reuse the same socket

* Allow to log values of different categories

* Allow to log events

* Pass the timestamp to influxdb

* Send events in batches

* Send data async

* Log server shutdown.
Fix memory leak.

* Allow to enable/disable Stats in the settings and at runtime

* Read interval between each batch send from config

* Add InfluxDB connection info to configs

* Move each event category to its own table

* Log pathfinding queries

* Move categories table initialization to constructor using enum as key to avoid assigning the table name to the wrong enum value

* Log player login/logout events.
Pass the hostname correctly in the HTTP request.

* Fix linux build

* Handle "Connection: close" HTTP header, reconnecting on next scheduled send.
Disable StatsLogger if connection fails, logging the error.

* Add an enum for categories of logged values, it's still possible to pass a string instead of the enum.

* Don't log the whole batchedData when InfluxDB returns an error, it's too long and unreadable on console.

* Allow to call a function at a specified interval in thread-safe World::Update() context to log data like player count.

* Log map tile load/unload

* Core/StatsLogger: Allow logging more value types other than ints

https://docs.influxdata.com/influxdb/v0.10/write_protocols/write_syntax/

* Fix a typo in string escape of StatsLogger

* Yet more fixes to the escaping in FormatInfluxDBValue

* DB/Gameobject: Fix respawn time of few Quest GameObjects

By Tauriella, closes #16701

* DB/Misc: Fix some engrish

By tkrokli closes #16648

* Tools/MMaps: Add format library linking to mmaps_generator

(Very) partial cherry pick of ed75b0649a

* Core/StatsLogger: Simplify code

Convert values and categories arrays to maps initialized in-place
Remove constructor and destructor

* Core/StatsLogger: Add realm name to the event and value tags

* Log amount of processed packet of each session

* Apply recent singleton changes to sStatsLogger too

* Fix influxdb data format if no realm name is present

* Remove unneeded newlines from request body, fixes response 400 from InfluxDB 0.10

* Rename Reporting folder to Metric

* Rename StatsLogger to Metric

* Rename InfluxDB configs to Metric

* Add Grafana dashboards

* Add a random annoying macro

* Move string formatting to Metric::SendBatch(), reducing performance footprint of Metric::LogEvent() and Metric::LogValue()

* Update grafana graphs refresing tags on load and showing now-15m data, refreshing every minute. These settings can be modified in grafana.

* Rename MetricData fields

* Contrib/Grafana: Rename dashboard files

* Contrib/Grafana: Replace hardcoded Windows/Ubuntu realm names by the default, Trinity

* Config/Worldserver: Add missing section to the index

* Contrib/Grafana: Add singlestat panels with current online players, update diff averages (1 min, 5 mins and 15 mins)

http://i.imgur.com/Zi8lfvS.png

* Core/Metric: Replace the enums MetricEventCategory and MetricValueCategory by strings

For the sake of simplicity and less recompile time when adding new metrics, similar to how TC_LOG_* works

* Contrib/Grafana: Display the current number of online players and not its average

Closes #15075
(cherry picked from commit 3ae1016082)

# Conflicts:
#	src/server/game/Server/WorldSession.cpp
#	src/server/game/World/World.cpp
#	src/server/worldserver/Main.cpp
2016-06-04 11:26:57 +01:00