Skip to content

Commit

Permalink
feat(SystemMetricsSender): pass settings to speed up linux process me…
Browse files Browse the repository at this point in the history
…trics collecting
  • Loading branch information
Vitaliy Roshchupkin committed Apr 5, 2024
1 parent a83c927 commit 28f3997
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ private void RegisterProcessMonitor(SystemMetricsSettings settings, BuildContext
var collectorSettings = new CurrentProcessMetricsSettings
{
CpuCoresLimitProvider = () => context.ApplicationLimits.CpuUnits,
MemoryBytesLimitProvider = () => context.ApplicationLimits.MemoryBytes
MemoryBytesLimitProvider = () => context.ApplicationLimits.MemoryBytes,
LinuxSettings = settings.LinuxProcessMetricsSettings
};

var collector = new CurrentProcessMetricsCollector(collectorSettings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using JetBrains.Annotations;
using Vostok.Commons.Time;
using Vostok.Metrics.System.Host;
using Vostok.Metrics.System.Process;

namespace Vostok.Hosting.Components.SystemMetrics
{
Expand All @@ -24,6 +25,8 @@ public class SystemMetricsSettings

public HostMetricsSettings HostMetricsSettings { get; set; } = new HostMetricsSettings();

public LinuxProcessMetricsSettings LinuxProcessMetricsSettings { get; set; } = new LinuxProcessMetricsSettings();

public TimeSpan GcMinimumDurationForLogging { get; set; } = 500.Milliseconds();

public TimeSpan ProcessMetricsLoggingPeriod { get; set; } = 10.Seconds();
Expand Down
2 changes: 2 additions & 0 deletions Vostok.Hosting/PublicAPI/net6.0/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Vostok.Hosting.Components.SystemMetrics.SystemMetricsSettings.LinuxProcessMetricsSettings.get -> Vostok.Metrics.System.Process.LinuxProcessMetricsSettings
Vostok.Hosting.Components.SystemMetrics.SystemMetricsSettings.LinuxProcessMetricsSettings.set -> void
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Vostok.Hosting.Components.SystemMetrics.SystemMetricsSettings.LinuxProcessMetricsSettings.get -> Vostok.Metrics.System.Process.LinuxProcessMetricsSettings
Vostok.Hosting.Components.SystemMetrics.SystemMetricsSettings.LinuxProcessMetricsSettings.set -> void
2 changes: 1 addition & 1 deletion module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ notests *default:
- vostok.logging.tracing
- vostok.metrics
- vostok.metrics.hercules
- vostok.metrics.system
- vostok.metrics.system@linux_slow_metrics
- vostok.servicediscovery
- vostok.servicediscovery.abstractions
- vostok.tracing
Expand Down

0 comments on commit 28f3997

Please sign in to comment.