Add metrics for group count
This commit is contained in:
parent
04960067c6
commit
10d6968734
@ -78,11 +78,12 @@ namespace PluralKit.Bot
|
|||||||
_metrics.Measure.Gauge.SetValue(BotMetrics.MembersOnline, usersOnline.Count);
|
_metrics.Measure.Gauge.SetValue(BotMetrics.MembersOnline, usersOnline.Count);
|
||||||
|
|
||||||
// Aggregate DB stats
|
// Aggregate DB stats
|
||||||
var counts = await _db.Execute(c => c.QueryFirstAsync<Counts>("select (select count(*) from systems) as systems, (select count(*) from members) as members, (select count(*) from switches) as switches, (select count(*) from messages) as messages"));
|
var counts = await _db.Execute(c => c.QueryFirstAsync<Counts>("select (select count(*) from systems) as systems, (select count(*) from members) as members, (select count(*) from switches) as switches, (select count(*) from messages) as messages, (select count(*) from groups) as groups"));
|
||||||
_metrics.Measure.Gauge.SetValue(CoreMetrics.SystemCount, counts.Systems);
|
_metrics.Measure.Gauge.SetValue(CoreMetrics.SystemCount, counts.Systems);
|
||||||
_metrics.Measure.Gauge.SetValue(CoreMetrics.MemberCount, counts.Members);
|
_metrics.Measure.Gauge.SetValue(CoreMetrics.MemberCount, counts.Members);
|
||||||
_metrics.Measure.Gauge.SetValue(CoreMetrics.SwitchCount, counts.Switches);
|
_metrics.Measure.Gauge.SetValue(CoreMetrics.SwitchCount, counts.Switches);
|
||||||
_metrics.Measure.Gauge.SetValue(CoreMetrics.MessageCount, counts.Messages);
|
_metrics.Measure.Gauge.SetValue(CoreMetrics.MessageCount, counts.Messages);
|
||||||
|
_metrics.Measure.Gauge.SetValue(CoreMetrics.GroupCount, counts.Groups);
|
||||||
|
|
||||||
// Process info
|
// Process info
|
||||||
var process = Process.GetCurrentProcess();
|
var process = Process.GetCurrentProcess();
|
||||||
@ -109,6 +110,7 @@ namespace PluralKit.Bot
|
|||||||
public int Members { get; }
|
public int Members { get; }
|
||||||
public int Switches { get; }
|
public int Switches { get; }
|
||||||
public int Messages { get; }
|
public int Messages { get; }
|
||||||
|
public int Groups { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,6 +11,7 @@ namespace PluralKit.Core
|
|||||||
public static GaugeOptions MemberCount => new GaugeOptions { Name = "Members", MeasurementUnit = Unit.Items };
|
public static GaugeOptions MemberCount => new GaugeOptions { Name = "Members", MeasurementUnit = Unit.Items };
|
||||||
public static GaugeOptions MessageCount => new GaugeOptions { Name = "Messages", MeasurementUnit = Unit.Items };
|
public static GaugeOptions MessageCount => new GaugeOptions { Name = "Messages", MeasurementUnit = Unit.Items };
|
||||||
public static GaugeOptions SwitchCount => new GaugeOptions { Name = "Switches", MeasurementUnit = Unit.Items };
|
public static GaugeOptions SwitchCount => new GaugeOptions { Name = "Switches", MeasurementUnit = Unit.Items };
|
||||||
|
public static GaugeOptions GroupCount => new GaugeOptions { Name = "Groups", MeasurementUnit = Unit.Items };
|
||||||
|
|
||||||
public static GaugeOptions ProcessPhysicalMemory => new GaugeOptions { Name = "Process Physical Memory", MeasurementUnit = Unit.Bytes, Context = "Process" };
|
public static GaugeOptions ProcessPhysicalMemory => new GaugeOptions { Name = "Process Physical Memory", MeasurementUnit = Unit.Bytes, Context = "Process" };
|
||||||
public static GaugeOptions ProcessVirtualMemory => new GaugeOptions { Name = "Process Virtual Memory", MeasurementUnit = Unit.Bytes, Context = "Process" };
|
public static GaugeOptions ProcessVirtualMemory => new GaugeOptions { Name = "Process Virtual Memory", MeasurementUnit = Unit.Bytes, Context = "Process" };
|
||||||
|
Loading…
Reference in New Issue
Block a user