Skip to content

Commit 3759e90

Browse files
authored
Improve monitoring plugin (#3374)
1 parent 764ec31 commit 3759e90

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ArchiSteamFarm.OfficialPlugins.Monitoring/MonitoringPlugin.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,12 @@ private void InitializeMeter() {
151151
return;
152152
}
153153

154+
int officialPluginCount = PluginsCore.ActivePlugins.Count(static plugin => plugin is OfficialPlugin);
155+
154156
PluginMeasurements = new HashSet<Measurement<int>>(3) {
155157
new(PluginsCore.ActivePlugins.Count),
156-
new(PluginsCore.ActivePlugins.Count(static plugin => plugin is OfficialPlugin), new KeyValuePair<string, object?>(TagNames.PluginType, "official")),
157-
new(PluginsCore.ActivePlugins.Count(static plugin => plugin is not OfficialPlugin), new KeyValuePair<string, object?>(TagNames.PluginType, "custom"))
158+
new(officialPluginCount, new KeyValuePair<string, object?>(TagNames.PluginType, "official")),
159+
new(PluginsCore.ActivePlugins.Count - officialPluginCount, new KeyValuePair<string, object?>(TagNames.PluginType, "custom"))
158160
}.ToFrozenSet();
159161

160162
Meter = new Meter(MeterName, Version.ToString());

0 commit comments

Comments
 (0)