public static void Register(ObjectStore store, MetricCacher metricCacher) { foreach (var propertyInfo in MemInfo.AllProperties.Values) { store.Add(new ServerMemInfoValue(propertyInfo, metricCacher)); } }
internal static MachineResources GetMachineResources(MetricCacher metricCacher, LowMemoryMonitor lowMemoryMonitor, ICpuUsageCalculator cpuUsageCalculator) { var memInfo = metricCacher.GetValue <MemoryInfoResult>(MetricCacher.Keys.Server.MemoryInfoExtended); var cpuInfo = metricCacher.GetValue(MetricCacher.Keys.Server.CpuUsage, cpuUsageCalculator.Calculate); var machineResources = new MachineResources { TotalMemory = memInfo.TotalPhysicalMemory.GetValue(SizeUnit.Bytes), AvailableMemory = memInfo.AvailableMemory.GetValue(SizeUnit.Bytes), AvailableWithoutTotalCleanMemory = memInfo.AvailableWithoutTotalCleanMemory.GetValue(SizeUnit.Bytes), SystemCommitLimit = memInfo.TotalCommittableMemory.GetValue(SizeUnit.Bytes), CommittedMemory = memInfo.CurrentCommitCharge.GetValue(SizeUnit.Bytes), ProcessMemoryUsage = memInfo.WorkingSet.GetValue(SizeUnit.Bytes), IsWindows = PlatformDetails.RunningOnPosix == false, IsLowMemory = LowMemoryNotification.Instance.IsLowMemory(memInfo, lowMemoryMonitor, out var commitChargeThreshold), LowMemoryThreshold = LowMemoryNotification.Instance.LowMemoryThreshold.GetValue(SizeUnit.Bytes), CommitChargeThreshold = commitChargeThreshold.GetValue(SizeUnit.Bytes), MachineCpuUsage = cpuInfo.MachineCpuUsage, ProcessCpuUsage = cpuInfo.ProcessCpuUsage }; return(machineResources); }
public ServerGcFinalizationPendingCount(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcFinalizationPendingCount) { }
public ServerGcPinnedObjectsCount(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcPinnedObjectsCount) { }
public ServerGcHeapSize(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcHeapSize) { }
public ServerGcGeneration(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcGeneration) { }
protected ServerGcPauseDurationsBase(MetricCacher metricCacher, GCKind gcKind, string dots, int pauseDurationsIndex) : base(metricCacher, gcKind, dots) { _pauseDurationsIndex = pauseDurationsIndex; }
protected ServerGcBase(MetricCacher metricCacher, GCKind gcKind, string dots) : base(dots, (int)gcKind) { _metricCacher = metricCacher; _cacheKey = GetCacheKey(gcKind); }
public ServerGcCompacted(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcCompacted) { }
public ServerGcTotalAvailableMemory(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcTotalAvailableMemory) { }
public ServerGcPauseTimePercentage(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcPauseTimePercentage) { }
public ServerMemInfoValue(PropertyInfo propertyInfo, MetricCacher metricCacher) : base(string.Format(SnmpOids.Server.MemInfoPrefix, propertyInfo.GetCustomAttribute <SnmpIndexAttribute>().Index)) { _propertyInfo = propertyInfo; _metricCacher = metricCacher; }
public ServerTotalMemory(MetricCacher metricCacher) : base(SnmpOids.Server.TotalMemory) { _metricCacher = metricCacher; }
public ServerGcConcurrent(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcConcurrent) { }
public ServerGcTotalCommitted(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcTotalCommitted) { }
public ServerGcPauseDurations1(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcPauseDurations1, 0) { }
public ServerTotalSwapUsage(MetricCacher metricCacher) : base(SnmpOids.Server.TotalSwapUsage) { _metricCacher = metricCacher; }
public ServerGcMemoryLoad(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcMemoryLoad) { }
public ServerGcHighMemoryLoadThreshold(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcHighMemoryLoadThreshold) { }
public ServerWorkingSetSwapUsage(MetricCacher metricCacher) : base(SnmpOids.Server.WorkingSetSwapUsage) { _metricCacher = metricCacher; }
public ServerGcIndex(MetricCacher metricCacher, GCKind gcKind) : base(metricCacher, gcKind, SnmpOids.Server.GcIndex) { }
public MachineCpu(MetricCacher metricCacher, ICpuUsageCalculator calculator) : base(SnmpOids.Server.MachineCpu) { _metricCacher = metricCacher; _calculator = calculator; }
public ProcessCpu(MetricCacher metricCacher, ICpuUsageCalculator calculator) : base(SnmpOids.Server.ProcessCpu) { _metricCacher = metricCacher; _calculator = calculator; }