Versiones comparadas

Clave

  • Se ha añadido esta línea.
  • Se ha eliminado esta línea.
  • El formato se ha cambiado.

...

  1. Download and install InfluxDB 1.x from https://influxdata.com/downloads/#influxdb for your platform. InfluxDB 2.x is not currently supported.

  2. Start InfluxDB

  3. Create a user and a database for TC in InfluxDB using the Influx CLI and executing the commands below

    Bloque de código
    languagesql
    themeConfluence
    CREATE DATABASE worldserver
    CREATE USER grafana WITH PASSWORD 'grafana'
    GRANT READ ON worldserver TO grafana


  4. Edit the default retention policy to ensure the InfluxDB database doesn't grow too much.

    Bloque de código
    languagesql
    themeConfluence
    USE worldserver
    SHOW RETENTION POLICIES


    Refer to https://docs.influxdata.com/influxdb/v1.8/query_language/manage-database/ on how to manage retention policies.

Installing Grafana

  1. Download and install Grafana from http://docs.grafana.org/installation/
  2. Open the dashboard at http://localhost:3000
  3. Login with username admin and password admin (defaults can be changed in Grafana's .ini files)
  4. Go to Data Sources → + Add Data Source
    Name: Influx
    Type: InfluxDB
    Urlhttp://localhost:8086
    Access: ProxyServer
    Database: worldserver User: grafana Password: grafana
  5. Go to Dashboards Import and import Click on the + sign in the menu on the left called "Create" and select "Dashboard", then import each .json file in TrinityCore's /contrib/grafana clicking on "Upload JSON file"

Configuring TrinityCore

  1. Edit the worldserver.conf file
  2. Set Metric.Enable = 1
  3. Edit Metric.ConnectionInfo with connection details (e.g "127.0.0.1;8086;worldserver")
  4. Start worldserver, the dashboard should now start receiving values

...

  • I/O networking traffic:
    • Packets sent (error)
    • Packets received (tic)
    • Average ping (error)
    • Traffic in (error)
    • Traffic out (error)
  • World session update time (tic)
  • Map update time (error)(tic)
  • Map loads/unloads (tic)
  • MMap queries (tic)
  • Database async queries queued count (error)(tic)
  • Server uptime (tic) (through world initialize and world shutdown events)
  • Active connections (error)
  • Queued connections (error)

...

Bloque de código
languagecpp
themeConfluence
titleExamples
linenumberstrue
// Registering player logins: in WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
TC_METRIC_EVENT("player_events", "Login", pCurrChar->GetName());
 
// Logging the update diff time: in World::Update(uint32 diff)
TC_METRIC_VALUE("update_time_diff", diff);

...


Additional visualizations and metrics collection

Image Removed


Sección

InfluxDB is part of a bigger set of projects by InfluxData which integrate nicely with the DB:

Columna
Columna
  • Telegraf can be used to collect system metrics like CPU, I/O, memory usage and other services such as MySQL – to display this info next to the TC metrics.
  • Chronograf is an alternative to Grafana to graph and visualize time-series metrics.
  • Kapacitator is able to process streaming data from InfluxDB to provide alerts, trigger events, detect anomalies or transform data.


...