-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMetricFactory.cs
More file actions
28 lines (21 loc) · 879 Bytes
/
Copy pathMetricFactory.cs
File metadata and controls
28 lines (21 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Generated By: Claude Code (Claude Opus 4.7)
using NINA.Profile.Interfaces;
using System;
using System.Linq;
namespace NINA.Plugin.PrometheusExporter;
internal sealed class MetricFactory
{
private readonly IProfileService _profileService;
private readonly string _hostName;
public MetricFactory(IProfileService profileService)
{
_profileService = profileService;
_hostName = Environment.MachineName ?? Constants.Unknown;
}
public string ProfileName => _profileService?.ActiveProfile?.Name ?? Constants.Unknown;
public string HostName => _hostName;
public string[] LabelNames(params string[] extra) =>
new[] { Constants.LabelProfileName, Constants.LabelHostName }.Concat(extra).ToArray();
public string[] LabelValues(params string[] extra) =>
new[] { ProfileName, _hostName }.Concat(extra).ToArray();
}