public HostMetricsCollector(HostMetricsSettings settings) { this.settings = settings ?? new HostMetricsSettings(); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var collector = new NativeHostMetricsCollector_Windows(this.settings); nativeCollector = collector.Collect; disposeNativeCollector = collector.Dispose; } if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { var collector = new NativeHostMetricsCollector_Linux(this.settings); nativeCollector = collector.Collect; disposeNativeCollector = collector.Dispose; } cache = new ThrottlingCache <HostMetrics>(CollectInternal, CacheTTL); }
public NativeHostMetricsCollector_Linux(HostMetricsSettings settings) { this.settings = settings; cpuCollector = new HostCpuUtilizationCollector(GetProcessorCount); }
public NativeHostMetricsCollector_Windows(HostMetricsSettings settings) => this.settings = settings;
public HostMonitor(HostMetricsSettings settings) => this.settings = settings;