Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CPU resource monitor for Linux systems #4888

Merged
merged 23 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
efcca1e
Replace free call on linux
vmapetr Jul 8, 2024
c66abe8
Merge branch 'master' into v-mpetrov/us-2190905-improve-resource-monitor
vmapetr Jul 10, 2024
1e59693
Minor fixes
vmapetr Jul 10, 2024
ea9dfae
Rework CPU info for linux
vmapetr Jul 10, 2024
cf1a22f
Fix typos
vmapetr Jul 10, 2024
ef9e60b
Fix issue with memory monitor
vmapetr Jul 11, 2024
f6ec823
Add comments
vmapetr Jul 11, 2024
e657974
Remove task run delegates
vmapetr Jul 12, 2024
5cda622
Fix for macos
vmapetr Jul 13, 2024
3e053ad
Merge branch 'master' into v-mpetrov/us-2190905-improve-resource-monitor
vmapetr Jul 15, 2024
ffb29f7
Expand comments for metrics methods
vmapetr Jul 15, 2024
ffb239b
Remove unnecessary cancellation exits
vmapetr Jul 15, 2024
621c110
Merge branch 'master' into v-mpetrov/us-2190905-improve-resource-monitor
vmapetr Jul 18, 2024
dbd552c
Add FF to disable resource monitor on debug runs
vmapetr Jul 18, 2024
f053b8d
Minor fix
vmapetr Jul 18, 2024
ca67e50
Fix warning
vmapetr Jul 18, 2024
dc2f5a2
Merge branch 'master' into v-mpetrov/us-2190905-improve-resource-monitor
vmapetr Jul 18, 2024
7a583be
Merge branch 'master' into v-mpetrov/us-2190905-improve-resource-monitor
vmapetr Jul 31, 2024
677ddba
Merge branch 'master' into v-mpetrov/us-2190905-improve-resource-monitor
vmapetr Aug 12, 2024
79022e0
Replace DisableResourceMonitorDebugOutput with EnableResourceMonitorD…
vmapetr Aug 12, 2024
f6e0041
Fix typo
vmapetr Aug 13, 2024
ea4e9b4
Update variable name
vmapetr Aug 13, 2024
9c0f83a
Fix typo
vmapetr Aug 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,12 @@ public class AgentKnobs
new EnvironmentKnobSource("AGENT_DISABLE_DRAIN_QUEUES_AFTER_TASK"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob EnableResourceMonitorDebugOutput = new Knob(
nameof(EnableResourceMonitorDebugOutput),
"If true, the agent will show the resource monitor output for debug runs",
new RuntimeKnobSource("AZP_ENABLE_RESOURCE_MONITOR_DEBUG_OUTPUT"),
new EnvironmentKnobSource("AZP_ENABLE_RESOURCE_MONITOR_DEBUG_OUTPUT"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob EnableResourceUtilizationWarnings = new Knob(
nameof(EnableResourceUtilizationWarnings),
Expand Down
9 changes: 8 additions & 1 deletion src/Agent.Worker/JobRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,14 @@ public async Task<TaskResult> RunAsync(Pipelines.AgentJobRequestMessage message,

if (string.Equals(systemDebug, "true", StringComparison.OrdinalIgnoreCase))
{
_ = resourceDiagnosticManager.RunDebugResourceMonitorAsync();
if (AgentKnobs.EnableResourceMonitorDebugOutput.GetValue(jobContext).AsBoolean())
{
_ = resourceDiagnosticManager.RunDebugResourceMonitorAsync();
}
else
{
jobContext.Debug(StringUtil.Loc("ResourceUtilizationDebugOutputIsDisabled"));
}
}

agentShutdownRegistration = HostContext.AgentShutdownToken.Register(() =>
Expand Down
Loading
Loading