Cómo analizar tus estadísticas de CSGO con este template de InfluxDB

· 3 min de lectura
Cómo analizar tus estadísticas de CSGO con este template de InfluxDB


En este artículo, te muestro un dashboard que hice para InfluxDB v2.0 para analizar mis estadísticas de CSGO.

La data es hermosa y es una realidad que sin ella, no podemos mejorar o por lo menos tomar decisiones para hacer ese camino.

Hay un dicho que dice, si no lo puedes medir, no lo puedes mejorar.

En fin, desde que empezó todo el tema del COVID, comencé a jugar CSGO, en partidas casuales al principio y después en modos competitivos. Me divierte y de a poco estoy mejorando, pero quiero mejorar más y quiero entender mucho más mi juego.

Con este fin arme un dashboard para InfluxDB con estadísticas de la última partida, datos generales y performance de disparos, hits y muertes por arma.

Los archivos necesarios para armar este dashboard, los pueden encontrar acá:

xe-nvdk/community-templates
A collection of InfluxDB Templates provided by the Influx community - xe-nvdk/community-templates

La data la saco de una API que tiene publicada Steam. Para poder explotarla, necesitamos una API Key que la pueden conseguir en este enlace:

https://steamcommunity.com/dev/apikey

También necesitamos nuestro ID de Steam. El mismo lo pueden encontrar acá:

Steam ID Finder
Steam ID Finder is a tool that allows you to find your steam ID quickly and easily.

Con estos dos datos, editamos el archivo csgo.sh y lo guardamos en el servidor.

Luego, lo que debemos hacer es pasar algunas variables de entorno para poder importar con un solo comando el dashboard, bucket y la configuración:

Primero el Token

export INFLUX_TOKEN=<tu-token>

Luego, la organización

export INFLUX_ORG=<tu-org>

Si estamos parados en el InfluxDB, ejecutamos:

influx pkg -u https://raw.githubusercontent.com/influxdata/community-templates/master/csgo/csgo.yml

Si todo esta bien, deberías ver algo como esto:

LABELS    +add | -remove | unchanged
+-----+--------------------------+------------------+---------------+---------+-------------+
| +/- |       PACKAGE NAME       |        ID        | RESOURCE NAME |  COLOR  | DESCRIPTION |
+-----+--------------------------+------------------+---------------+---------+-------------+
|     | optimistic-newton-b2f001 | 05d0f946c9c64000 | csgo          | #ce58eb |             |
+-----+--------------------------+------------------+---------------+---------+-------------+
|                                                                      TOTAL  |      1      |
+-----+--------------------------+------------------+---------------+---------+-------------+

BUCKETS    +add | -remove | unchanged
+-----+-----------------------+------------------+---------------+------------------+-------------+
| +/- |     PACKAGE NAME      |        ID        | RESOURCE NAME | RETENTION PERIOD | DESCRIPTION |
+-----+-----------------------+------------------+---------------+------------------+-------------+
|     | naughty-merkle-72f003 | 05cfd83e77f2f000 | csgo          | 0s               |             |
+-----+-----------------------+------------------+---------------+------------------+-------------+
|                                                                       TOTAL       |      1      |
+-----+-----------------------+------------------+---------------+------------------+-------------+

DASHBOARDS    +add | -remove | unchanged
+-----+-----------------------+----+--------------------------------+-------------+------------+
| +/- |     PACKAGE NAME      | ID |         RESOURCE NAME          | DESCRIPTION | NUM CHARTS |
+-----+-----------------------+----+--------------------------------+-------------+------------+
| +   | dreamy-germain-f2f001 |    | CSGO (Counter Strike: Global   |             | 55         |
|     |                       |    | Offensive)                     |             |            |
+-----+-----------------------+----+--------------------------------+-------------+------------+
|                                                                        TOTAL    |     1      |
+-----+-----------------------+----+--------------------------------+-------------+------------+

TELEGRAF CONFIGURATIONS    +add | -remove | unchanged
+-----+---------------+----+---------------+-------------+
| +/- | PACKAGE NAME  | ID | RESOURCE NAME | DESCRIPTION |
+-----+---------------+----+---------------+-------------+
| +   | csgo-telegraf |    | csgo-telegraf |             |
+-----+---------------+----+---------------+-------------+
|                                TOTAL     |      1      |
+-----+---------------+----+---------------+-------------+

LABEL ASSOCIATIONS    +add | -remove | unchanged
+-----+---------------+-----------------------+--------------------------------+------------------+--------------------------+------------+------------------+
| +/- | RESOURCE TYPE | RESOURCE PACKAGE NAME |         RESOURCE NAME          |   RESOURCE ID    |    LABEL PACKAGE NAME    | LABEL NAME |     LABEL ID     |
+-----+---------------+-----------------------+--------------------------------+------------------+--------------------------+------------+------------------+
|     | buckets       | naughty-merkle-72f003 | csgo                           | 05cfd83e77f2f000 | optimistic-newton-b2f001 | csgo       | 05d0f946c9c64000 |
+-----+---------------+-----------------------+--------------------------------+------------------+--------------------------+------------+------------------+
+-----+---------------+-----------------------+--------------------------------+------------------+--------------------------+------------+------------------+
| +   | dashboards    | dreamy-germain-f2f001 | CSGO (Counter Strike: Global   |                  | optimistic-newton-b2f001 | csgo       | 05d0f946c9c64000 |
|     |               |                       | Offensive)                     |                  |                          |            |                  |
+-----+---------------+-----------------------+--------------------------------+------------------+--------------------------+------------+------------------+
|                                                                                                                                TOTAL    |        2         |
+-----+---------------+-----------------------+--------------------------------+------------------+--------------------------+------------+------------------+

Confirm application of the above resources (y/n): 

Confirmamos con "y" en el mismos segundo, nos responde con otra pantalla parecida:

LABELS
+--------------------------+------------------+---------------+--------------------------------+---------+
|       PACKAGE NAME       |        ID        | RESOURCE NAME |          DESCRIPTION           |  COLOR  |
+--------------------------+------------------+---------------+--------------------------------+---------+
| optimistic-newton-b2f001 | 05d0f946c9c64000 |     csgo      |                                | #ce58eb |
+--------------------------+------------------+---------------+--------------------------------+---------+
|                                                                           TOTAL              |    1    |
+--------------------------+------------------+---------------+--------------------------------+---------+

BUCKETS
+-----------------------+------------------+---------------+-----------+--------------------------------+
|     PACKAGE NAME      |        ID        | RESOURCE NAME | RETENTION |          DESCRIPTION           |
+-----------------------+------------------+---------------+-----------+--------------------------------+
| naughty-merkle-72f003 | 05cfd83e77f2f000 |     csgo      |    inf    |                                |
+-----------------------+------------------+---------------+-----------+--------------------------------+
|                                                              TOTAL   |               1                |
+-----------------------+------------------+---------------+-----------+--------------------------------+

DASHBOARDS
+-----------------------+------------------+--------------------------------+--------------------------------+
|     PACKAGE NAME      |        ID        |         RESOURCE NAME          |          DESCRIPTION           |
+-----------------------+------------------+--------------------------------+--------------------------------+
| dreamy-germain-f2f001 | 05d11b276d864000 |  CSGO (Counter Strike: Global  |                                |
|                       |                  |           Offensive)           |                                |
+-----------------------+------------------+--------------------------------+--------------------------------+
|                                                        TOTAL              |               1                |
+-----------------------+------------------+--------------------------------+--------------------------------+

TELEGRAF CONFIGS
+---------------+------------------+---------------+--------------------------------+
| PACKAGE NAME  |        ID        | RESOURCE NAME |          DESCRIPTION           |
+---------------+------------------+---------------+--------------------------------+
| csgo-telegraf | 05d11b275a464000 | csgo-telegraf |                                |
+---------------+------------------+---------------+--------------------------------+
|                                        TOTAL     |               1                |
+---------------+------------------+---------------+--------------------------------+

LABEL ASSOCIATIONS
+---------------+--------------------------------+------------------+------------+------------------+
| RESOURCE TYPE |         RESOURCE NAME          |   RESOURCE ID    | LABEL NAME |     LABEL ID     |
+---------------+--------------------------------+------------------+------------+------------------+
|    buckets    |              csgo              | 05cfd83e77f2f000 |    csgo    | 05d0f946c9c64000 |
+---------------+--------------------------------+------------------+------------+------------------+
|  dashboards   |  CSGO (Counter Strike: Global  | 05d11b276d864000 |    csgo    | 05d0f946c9c64000 |
|               |           Offensive)           |                  |            |                  |
+---------------+--------------------------------+------------------+------------+------------------+
|                                                                       TOTAL    |        2         |
+---------------+--------------------------------+------------------+------------+------------------+

Ahora, lo que podemos hacer es entrar al InfluxDB e ir a la opción "data" y luego ir al tab "telegraf" ahí veremos la configuración, hacemos un clic sobre "setup instructions" y nos mostrará algo como esto, no lo ejecutemos aún.

telegraf --config https://influx_host/api/v2/telegrafs/05d1066537b38000

Vamos a especificar algunos datos más como variable de entorno, en este caso, el bucket donde vamos a guardar la data:

$ export INFLUX_BUCKET=csgo
$ export INFLUX_HOST=http://influx_host

Y ahora sí

telegraf --config https://influx_host/api/v2/telegrafs/05d1066537b38000

Si todo sale bien, en un rato, deberíamos ver algunos datos:

Soy un perro. Ya lo sé :) 

Para ir cerrando

Espero que esto te haya gustado y esta data te sirva para mejorar tu juego, en mi caso, el hecho de tener estos datos es justamente eso.


baehost