Catalogger.NET/Catalogger.Backend/CataloggerMetrics.cs
2024-08-16 17:04:24 +02:00

88 lines
No EOL
2.1 KiB
C#

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"
};
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"
};
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"
};
}