2024-08-15 17:23:56 +02:00
|
|
|
using App.Metrics;
|
|
|
|
|
using App.Metrics.Gauge;
|
|
|
|
|
using App.Metrics.Meter;
|
|
|
|
|
using App.Metrics.Timer;
|
|
|
|
|
|
|
|
|
|
namespace Catalogger.Backend;
|
|
|
|
|
|
|
|
|
|
public static class CataloggerMetrics
|
|
|
|
|
{
|
|
|
|
|
public static MeterOptions MessagesReceived => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Messages received",
|
|
|
|
|
MeasurementUnit = Unit.Events,
|
|
|
|
|
RateUnit = TimeUnit.Seconds,
|
|
|
|
|
Context = "Bot"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static GaugeOptions GuildsCached => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Guilds cached",
|
|
|
|
|
MeasurementUnit = Unit.Items,
|
|
|
|
|
Context = "Bot"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static GaugeOptions ChannelsCached => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Channels cached",
|
|
|
|
|
MeasurementUnit = Unit.Items,
|
|
|
|
|
Context = "Bot"
|
|
|
|
|
};
|
2024-08-16 17:04:24 +02:00
|
|
|
|
2024-08-15 17:23:56 +02:00
|
|
|
public static GaugeOptions UsersCached => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Users cached",
|
|
|
|
|
MeasurementUnit = Unit.Items,
|
|
|
|
|
Context = "Bot"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static GaugeOptions MessagesStored => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Messages stored",
|
|
|
|
|
MeasurementUnit = Unit.Items,
|
|
|
|
|
Context = "Bot"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static TimerOptions MetricsCollectionTime => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Metrics collection time",
|
|
|
|
|
MeasurementUnit = Unit.Events,
|
|
|
|
|
DurationUnit = TimeUnit.Milliseconds,
|
|
|
|
|
Context = "Bot"
|
|
|
|
|
};
|
2024-08-16 17:04:24 +02:00
|
|
|
|
2024-08-15 17:23:56 +02:00
|
|
|
public static GaugeOptions ProcessPhysicalMemory => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Process physical memory",
|
|
|
|
|
MeasurementUnit = Unit.Bytes,
|
|
|
|
|
Context = "Process"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static GaugeOptions ProcessVirtualMemory => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Process virtual memory",
|
|
|
|
|
MeasurementUnit = Unit.Bytes,
|
|
|
|
|
Context = "Process"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static GaugeOptions ProcessPrivateMemory => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Process private memory",
|
|
|
|
|
MeasurementUnit = Unit.Bytes,
|
|
|
|
|
Context = "Process"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static GaugeOptions ProcessThreads => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Process thread count",
|
|
|
|
|
MeasurementUnit = Unit.Threads,
|
|
|
|
|
Context = "Process"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static GaugeOptions ProcessHandles => new()
|
|
|
|
|
{
|
|
|
|
|
Name = "Process handle count",
|
|
|
|
|
MeasurementUnit = Unit.Items,
|
|
|
|
|
Context = "Process"
|
|
|
|
|
};
|
|
|
|
|
}
|