Skip to content

Commit

Permalink
Improve monitoring plugin (#3374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abrynos authored Jan 12, 2025
1 parent 764ec31 commit 3759e90
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ArchiSteamFarm.OfficialPlugins.Monitoring/MonitoringPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,12 @@ private void InitializeMeter() {
return;
}

int officialPluginCount = PluginsCore.ActivePlugins.Count(static plugin => plugin is OfficialPlugin);

PluginMeasurements = new HashSet<Measurement<int>>(3) {
new(PluginsCore.ActivePlugins.Count),
new(PluginsCore.ActivePlugins.Count(static plugin => plugin is OfficialPlugin), new KeyValuePair<string, object?>(TagNames.PluginType, "official")),
new(PluginsCore.ActivePlugins.Count(static plugin => plugin is not OfficialPlugin), new KeyValuePair<string, object?>(TagNames.PluginType, "custom"))
new(officialPluginCount, new KeyValuePair<string, object?>(TagNames.PluginType, "official")),
new(PluginsCore.ActivePlugins.Count - officialPluginCount, new KeyValuePair<string, object?>(TagNames.PluginType, "custom"))
}.ToFrozenSet();

Meter = new Meter(MeterName, Version.ToString());
Expand Down

0 comments on commit 3759e90

Please sign in to comment.