Catalogger.NET/Catalogger.Backend/CataloggerMetrics.cs

42 lines
No EOL
1.7 KiB
C#

using NodaTime;
using Prometheus;
namespace Catalogger.Backend;
public static class CataloggerMetrics
{
public static Instant Startup { get; set; }
public static readonly Gauge MessagesReceived =
Metrics.CreateGauge("catalogger_received_messages", "Number of messages Catalogger has received");
public static long MessageRateMinute { get; set; }
public static readonly Gauge GuildsCached =
Metrics.CreateGauge("catalogger_cache_guilds", "Number of guilds in the cache");
public static readonly Gauge ChannelsCached =
Metrics.CreateGauge("catalogger_cache_channels", "Number of channels in the cache");
public static readonly Gauge UsersCached =
Metrics.CreateGauge("catalogger_cache_users", "Number of users in the cache");
public static readonly Gauge MessagesStored =
Metrics.CreateGauge("catalogger_stored_messages", "Number of users in the cache");
public static readonly Summary MetricsCollectionTime =
Metrics.CreateSummary("catalogger_time_metrics", "Time it took to collect metrics");
public static Gauge ProcessPhysicalMemory =>
Metrics.CreateGauge("catalogger_process_physical_memory", "Process physical memory");
public static Gauge ProcessVirtualMemory =>
Metrics.CreateGauge("catalogger_process_virtual_memory", "Process virtual memory");
public static Gauge ProcessPrivateMemory =>
Metrics.CreateGauge("catalogger_process_private_memory", "Process private memory");
public static Gauge ProcessThreads => Metrics.CreateGauge("catalogger_process_threads", "Process thread count");
public static Gauge ProcessHandles => Metrics.CreateGauge("catalogger_process_handles", "Process handle count");
}