diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-06-13 21:00:25 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-06-13 21:00:25 +0200 |
| commit | d2733eb6f1f9a550ec6511b5fa696b67b11044b3 (patch) | |
| tree | 92e101dba7e48661de4a02c93bfba5700a6f1bdf /src/server/worldserver | |
| parent | 3903482eb810625fce64c616a4edca3f06975e94 (diff) | |
| parent | 2fe6fc63d79655a96ee2135a6b380ce353729088 (diff) | |
Merge branch '6.x' of https://github.com/TrinityCore/TrinityCore into legion
Diffstat (limited to 'src/server/worldserver')
| -rw-r--r-- | src/server/worldserver/Main.cpp | 11 | ||||
| -rw-r--r-- | src/server/worldserver/worldserver.conf.dist | 42 |
2 files changed, 52 insertions, 1 deletions
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 5d8d0819102..2d14e3301a3 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -45,6 +45,7 @@ #include "RealmList.h" #include "DatabaseLoader.h" #include "AppenderDB.h" +#include "Metric.h" #include <openssl/opensslv.h> #include <openssl/crypto.h> #include <boost/asio/io_service.hpp> @@ -200,6 +201,13 @@ extern int main(int argc, char** argv) LoadRealmInfo(); + sMetric->Initialize(realm.Name, _ioService, []() + { + TC_METRIC_VALUE("online_players", sWorld->GetPlayerCount()); + }); + + TC_METRIC_EVENT("events", "Worldserver started", ""); + // Initialize the World sScriptMgr->SetScriptLoader(AddScripts); sWorld->SetInitialWorldSettings(); @@ -300,6 +308,9 @@ extern int main(int argc, char** argv) StopDB(); + TC_METRIC_EVENT("events", "Worldserver shutdown", ""); + sMetric->ForceSend(); + TC_LOG_INFO("server.worldserver", "Halting process..."); ShutdownCLIThread(cliThread); diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 3cd2222339c..73b5719ec18 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -37,6 +37,7 @@ # LOGGING SYSTEM SETTINGS # CURRENCIES SETTINGS # PACKET SPOOF PROTECTION SETTINGS +# METRIC SETTINGS # ################################################################################################### @@ -3301,7 +3302,7 @@ AuctionHouseBot.Items.Amount.Yellow = 0 # Armor: 8 # Reagent: 1 # Projectile: 2 -# TradeGod: 10 +# TradeGood: 10 # Generic: 1 # Recipe: 6 # Quiver: 1 @@ -3853,3 +3854,42 @@ PacketSpoof.BanDuration = 86400 # ################################################################################################### + +################################################################################################### +# METRIC SETTINGS +# +# These settings control the statistics sent to the metric database (currently InfluxDB) +# +# Metric.Enable +# Description: Enables statistics sent to the metric database. +# Default: 0 - (Disabled) +# 1 - (Enabled) + +Metric.Enable = 0 + +# +# Metric.Interval +# Description: Interval between every batch of data sent in seconds +# Default: 10 seconds +# + +Metric.Interval = 10 + +# +# Metric.ConnectionInfo +# Description: Connection settings for metric database (currently InfluxDB). +# Example: "hostname;port;database" +# Default: "127.0.0.1;8086;worldserver" + +Metric.ConnectionInfo = "127.0.0.1;8086;worldserver" + +# +# Metric.OverallStatusInterval +# Description: Interval between every gathering of overall worldserver status data in seconds +# Default: 1 second +# + +Metric.OverallStatusInterval = 1 + +# +################################################################################################### |
