add metrics (without reporting, for now)
This commit is contained in:
parent
5585ffd6ea
commit
14b132e466
9 changed files with 183 additions and 9 deletions
88
Catalogger.Backend/CataloggerMetrics.cs
Normal file
88
Catalogger.Backend/CataloggerMetrics.cs
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
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"
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue