Skip to content

Commit e7cffcf

Browse files
author
t-davidbrown-msft
authored
Resource monitor (Azure#48501)
* create cpu monitor - create method for monitoring CPU usage that works for all frameworks using System.Diagnostics.Process - create one test for ensuring that the monitor works * update cpu monitor logic - add CpuMonitor interface - add CpuMonitor tests - change CurrentProcessorTime to be the current time on the processor minute the previous * finished baseline cpu tuner - removed unnecessary refactor - add SimulateCpuLoad to test suite to simulate loading the CPU - add CoreCount Property to replace function calls to Environment.ProcessorCount * add testing - readd default constructor - add tests for monitoring interval that is below 100 milliseconds * create memory monitor - create processor directive to create memory monitor for netstandard2.0 or greater, but this is not a great implementation - create method for MonitorMemoryUsage is otherwise good - create tests to check whether it is below 1, above 0, and not null * add memory check for netstandard20 * rename CpuMonitor to ResourceMonitor * fix merge issue and add changes - remove interface - change private properties to fields - group private fields and properties - remove public default constrcutor - combine CPU and memory into one task and run on single thread - switch order in resource monitor: take reading first, then sleep - memory monitor returns Bytes instead of percentage - remove all functionality for getting total memory * change interface to concrete class * update tests * removed tests and updated resource monitor * increase simulate load time for mac * add functionality for mac os
1 parent d59823c commit e7cffcf

File tree

4 files changed

+564
-162
lines changed

4 files changed

+564
-162
lines changed

sdk/storage/Azure.Storage.DataMovement/src/ConcurrencyTuner/ConcurrencyTuner.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal class ConcurrencyTuner
1818
{
1919
internal int _initialConcurrency;
2020
internal int _maxConcurrency;
21-
public static CpuMonitor _cpuPerformance;
21+
public static ResourceMonitor _resourceMonitor;
2222
internal int _finalReason; // ConcurrencyTunerState
2323
internal int _finalConcurrency;
2424
internal SemaphoreSlim _lockFinal;
@@ -31,7 +31,7 @@ public ConcurrencyTuner(
3131
{
3232
_initialConcurrency = initialConcurrency;
3333
_maxConcurrency = maxConcurrency;
34-
_cpuPerformance = new CpuMonitor();
34+
_resourceMonitor = new ResourceMonitor();
3535
_finalReason = (int) ConcurrencyTunerState.ConcurrencyReasonNone;
3636
_finalConcurrency = _initialConcurrency;
3737
_observations = Channel.CreateUnbounded<ConcurrencyObservation>();

sdk/storage/Azure.Storage.DataMovement/src/ConcurrencyTuner/CpuMonitor.cs

Lines changed: 0 additions & 160 deletions
This file was deleted.

0 commit comments

Comments
 (0)