2019-07-16 19:59:06 +00:00
using App.Metrics ;
using App.Metrics.Gauge ;
using App.Metrics.Meter ;
2019-08-11 22:57:23 +00:00
using App.Metrics.Timer ;
2019-07-16 19:59:06 +00:00
namespace PluralKit.Bot
{
public static class BotMetrics
{
2021-08-27 15:03:47 +00:00
public static MeterOptions MessagesReceived = > new MeterOptions { Name = "Messages processed" , MeasurementUnit = Unit . Events , RateUnit = TimeUnit . Seconds , Context = "Bot" } ;
public static MeterOptions MessagesProxied = > new MeterOptions { Name = "Messages proxied" , MeasurementUnit = Unit . Events , RateUnit = TimeUnit . Seconds , Context = "Bot" } ;
public static MeterOptions CommandsRun = > new MeterOptions { Name = "Commands run" , MeasurementUnit = Unit . Commands , RateUnit = TimeUnit . Seconds , Context = "Bot" } ;
2021-09-25 18:15:24 +00:00
public static TimerOptions CommandTime = > new TimerOptions { Name = "Command run time" , MeasurementUnit = Unit . Commands , RateUnit = TimeUnit . Seconds , DurationUnit = TimeUnit . Seconds , Context = "Bot" } ;
2021-08-27 15:03:47 +00:00
public static GaugeOptions MembersTotal = > new GaugeOptions { Name = "Members total" , MeasurementUnit = Unit . None , Context = "Bot" } ;
public static GaugeOptions MembersOnline = > new GaugeOptions { Name = "Members online" , MeasurementUnit = Unit . None , Context = "Bot" } ;
public static GaugeOptions Guilds = > new GaugeOptions { Name = "Guilds" , MeasurementUnit = Unit . None , Context = "Bot" } ;
public static GaugeOptions Channels = > new GaugeOptions { Name = "Channels" , MeasurementUnit = Unit . None , Context = "Bot" } ;
public static GaugeOptions ShardLatency = > new GaugeOptions { Name = "Shard Latency" , Context = "Bot" } ;
2020-06-14 20:19:12 +00:00
public static GaugeOptions ShardsConnected = > new GaugeOptions { Name = "Shards Connected" , Context = "Bot" , MeasurementUnit = Unit . Connections } ;
public static MeterOptions WebhookCacheMisses = > new MeterOptions { Name = "Webhook cache misses" , Context = "Bot" , MeasurementUnit = Unit . Calls } ;
public static GaugeOptions WebhookCacheSize = > new GaugeOptions { Name = "Webhook Cache Size" , Context = "Bot" , MeasurementUnit = Unit . Items } ;
2019-08-12 00:05:30 +00:00
public static TimerOptions WebhookResponseTime = > new TimerOptions { Name = "Webhook Response Time" , Context = "Bot" , RateUnit = TimeUnit . Seconds , MeasurementUnit = Unit . Requests , DurationUnit = TimeUnit . Seconds } ;
2020-06-14 20:19:12 +00:00
public static TimerOptions MessageContextQueryTime = > new TimerOptions { Name = "Message context query duration" , Context = "Bot" , RateUnit = TimeUnit . Seconds , DurationUnit = TimeUnit . Seconds , MeasurementUnit = Unit . Calls } ;
public static TimerOptions ProxyMembersQueryTime = > new TimerOptions { Name = "Proxy member query duration" , Context = "Bot" , RateUnit = TimeUnit . Seconds , DurationUnit = TimeUnit . Seconds , MeasurementUnit = Unit . Calls } ;
2021-08-27 15:03:47 +00:00
public static TimerOptions DiscordApiRequests = > new TimerOptions { Name = "Discord API requests" , MeasurementUnit = Unit . Requests , DurationUnit = TimeUnit . Milliseconds , Context = "Bot" } ;
public static MeterOptions BotErrors = > new MeterOptions { Name = "Bot errors" , MeasurementUnit = Unit . Errors , RateUnit = TimeUnit . Seconds , Context = "Bot" } ;
public static MeterOptions ErrorMessagesSent = > new MeterOptions { Name = "Error messages sent" , MeasurementUnit = Unit . Errors , RateUnit = TimeUnit . Seconds , Context = "Bot" } ;
public static TimerOptions EventsHandled = > new TimerOptions { Name = "Events handled" , MeasurementUnit = Unit . Errors , RateUnit = TimeUnit . Seconds , DurationUnit = TimeUnit . Seconds , Context = "Bot" } ;
2019-07-16 19:59:06 +00:00
}
}