StatTrack

This is the cog guide for the stattrack cog. You will find detailed docs about usage and commands.

[p] is considered as your prefix.

Note

To use this cog, you will need to install and load it.

See the Getting my cogs page.

Resource Usage

CPU usage depends on your bot size and host machine performance. Because this is Python, the cog can (for the most part) only use one core. You can check the performance of the background loop with stattrackinfo.

For disk usage, this cog uses around 150KB per day. This is just around 50MB per year (the cog will NOT automatically delete old data so this will increase over time) It uses an SQLite database that requires no extra setup.

RAM usage will be at least double disk usage and may spike to more when commands are used or the loop is active.

Usage

Track your bot’s metrics and view them in Discord. This cog creates its own SQLite database to store data, using around 150KB per day.

Commands will output as a graph. Data can also be exported with [p]stattrack export into a few different formats.

Commands

stattrack

Syntax

[p]stattrack

Description

View my stats.

stattrack channels

Syntax

[p]stattrack channels [timespan=1d] [metrics]

Description

Get channel stats.

You can just run this command on its own to see all metrics, or specify some metrics - see below.

Arguments

[timespan] How long to look for, or all for all-time data. Defaults to 1 day. Must be at least 1 hour.

[metrics] The metrics to show. Valid options: total, text, voice, stage, category. Defaults to all of them.

Note that total will count users multiple times if they share multiple servers with the Red, while unique will only count them once.

Examples: Examples: - [p]stattrack servers 3w2d - [p]stattrack servers 5d - [p]stattrack servers all

stattrack commands

Syntax

[p]stattrack commands [timespan=1 day, 0:00:00]

Description

Get command usage stats.

Arguments

<timespan> How long to look for, or all for all-time data. Defaults to 1 day. Must be at least 1 hour.

Examples: - [p]stattrack commands 3w2d - [p]stattrack commands 5d - [p]stattrack commands all

stattrack export

Note

This command is locked to the bot owner.

Syntax

[p]stattrack export

Description

Export stattrack data.

stattrack export csv

Syntax

[p]stattrack export csv

Description

Export as CSV

stattrack export json

Syntax

[p]stattrack export json

Description

Export as JSON with pandas orient “split”

stattrack latency

Syntax

[p]stattrack latency [timespan=1 day, 0:00:00]

Tip

Alias: stattrack ping

Description

Get my latency stats.

Arguments

<timespan> How long to look for, or all for all-time data. Defaults to 1 day. Must be at least 1 hour.

Examples: - [p]stattrack latency 3w2d - [p]stattrack latency 5d - [p]stattrack latency all

stattrack looptime

Syntax

[p]stattrack looptime [timespan=1 day, 0:00:00]

Tip

Aliases: stattrack time, stattrack loop

Description

Get my loop time stats.

Arguments

<timespan> How long to look for, or all for all-time data. Defaults to 1 day. Must be at least 1 hour.

Examples: - [p]stattrack looptime 3w2d - [p]stattrack looptime 5d - [p]stattrack looptime all

stattrack maxpoints

Note

This command is locked to the bot owner.

Syntax

[p]stattrack maxpoints <maxpoints>

Description

Set the maximum number of points to plot. This affects the speed of graph plotting.

The default value is 25k (25000).

The more points you plot, the slower the plotting time will be.

This setting only affects graphs that are a longer timespan (1 month+).

Set maxpoints to -1 to disable this feature, therefore always plotting all points.

Otherwise, maxpoints must be at least 1k (1440).

Examples: - [p]stattrack maxpoints 10000 - plot up to 10k points - [p]stattrack maxpoints 75000 - plot up to 75k points - [p]stattrack maxpoints 1440 - the minimum value possible - [p]stattrack maxpoints 25000 - the default value - [p]stattrack maxpoints -1 - disable, always plot all points

stattrack messages

Syntax

[p]stattrack messages [timespan=1 day, 0:00:00]

Description

Get message stats.

Arguments

<timespan> How long to look for, or all for all-time data. Defaults to 1 day. Must be at least 1 hour.

Examples: - [p]stattrack messages 3w2d - [p]stattrack messages 5d - [p]stattrack messages all

stattrack servers

Syntax

[p]stattrack servers [timespan=1 day, 0:00:00]

Tip

Alias: stattrack guilds

Description

Get server stats.

Arguments

<timespan> How long to look for, or all for all-time data. Defaults to 1 day. Must be at least 1 hour.

Examples: - [p]stattrack servers 3w2d - [p]stattrack servers 5d - [p]stattrack servers all

stattrack status

Syntax

[p]stattrack status [timespan=1d] [metrics]

Description

Get status stats.

You can just run this command on its own to see all metrics, or specify some metrics - see below.

Arguments

[timespan] How long to look for, or all for all-time data. Defaults to 1 day. Must be at least 1 hour.

[metrics] The metrics to show. Valid options: online, idle, offline, dnd. Defaults to all of them.

Examples: - [p]stattrack status - show all metrics, 1 day - [p]stattrack status 3w2d - show all metrics, 3 weeks 2 days - [p]stattrack status 5d dnd online - show dnd & online, 5 days - [p]stattrack status all online idle - show online & idle, all time

stattrack system

Syntax

[p]stattrack system

Tip

Alias: stattrack sys

Description

Get system metrics.

stattrack system cpu

Syntax

[p]stattrack system cpu [timespan=1 day, 0:00:00]

Description

Get CPU stats.

Arguments

<timespan> How long to look for, or all for all-time data. Defaults to 1 day. Must be at least 1 hour.

Examples: - [p]stattrack system cpu 3w2d - [p]stattrack system cpu 5d - [p]stattrack system cpu all

stattrack system mem

Syntax

[p]stattrack system mem [timespan=1 day, 0:00:00]

Tip

Aliases: stattrack system memory, stattrack system ram

Description

Get memory usage stats.

Arguments

<timespan> How long to look for, or all for all-time data. Defaults to 1 day. Must be at least 1 hour.

Examples: - [p]stattrack system mem 3w2d - [p]stattrack system mem 5d - [p]stattrack system mem all

stattrack users

Syntax

[p]stattrack users [timespan=1d] [metrics]

Description

Get user stats.

You can just run this command on its own to see all metrics, or specify some metrics - see below.

Arguments

[timespan] How long to look for, or all for all-time data. Defaults to 1 day. Must be at least 1 hour.

[metrics] The metrics to show. Valid options: total, unique, humans, bots. Defaults to all of them.

Note that total will count users multiple times if they share multiple servers with the Red, while unique will only count them once.

Examples: - [p]stattrack users - show all metrics, 1 day - [p]stattrack users 3w2d - show all metrics, 3 weeks 2 days - [p]stattrack users 5d total unique - show total & unique, 5 days - [p]stattrack users all humans bots - show humans & bots, all time