Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitac948f7

Browse files
author
evgenyfedorov2
committed
PR Comments
1 parentd671e88 commitac948f7

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

‎src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/Linux/LinuxUtilizationProvider.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public LinuxUtilizationProvider(IOptions<ResourceMonitoringOptions> options, ILi
120120
unit:"1");
121121

122122
_=meter.CreateObservableUpDownCounter(
123-
name:ResourceUtilizationInstruments.ContainerMemoryUtilization,
123+
name:ResourceUtilizationInstruments.ContainerMemoryUsage,
124124
observeValues:()=>GetMeasurementWithRetry(()=>(long)MemoryUtilization()),
125125
unit:"By",
126126
description:"Memory usage of the container.");

‎src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/Windows/WindowsContainerSnapshotProvider.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ internal WindowsContainerSnapshotProvider(
131131
observeValue:()=>MemoryPercentage(()=>_processInfo.GetMemoryUsage()));
132132

133133
_=meter.CreateObservableUpDownCounter(
134-
name:ResourceUtilizationInstruments.ContainerMemoryUtilization,
134+
name:ResourceUtilizationInstruments.ContainerMemoryUsage,
135135
observeValue:()=>(long)MemoryUsage(()=>_processInfo.GetMemoryUsage()),
136136
unit:"By",
137137
description:"Memory usage of the container.");

‎src/Shared/Instruments/ResourceUtilizationInstruments.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ internal static class ResourceUtilizationInstruments
5151
publicconststringContainerMemoryLimitUtilization="container.memory.limit.utilization";
5252

5353
/// <summary>
54-
/// The name of an instrument to retrieve memoryconsumptionof all processes running inside a container or control group in range <c>[0, 1]</c>.
54+
/// The name of an instrument to retrieve memoryusage measured in bytesof all processes running inside a container or control group.
5555
/// </summary>
5656
/// <remarks>
57-
/// The type of an instrument is <see cref="System.Diagnostics.Metrics.ObservableGauge{T}"/>.
57+
/// The type of an instrument is <see cref="System.Diagnostics.Metrics.ObservableUpDownCounter{T}"/>.
5858
/// </remarks>
59-
publicconststringContainerMemoryUtilization="container.memory.utilization";
59+
publicconststringContainerMemoryUsage="container.memory.usage";
6060

6161
/// <summary>
6262
/// The name of an instrument to retrieve CPU consumption share of the running process in range <c>[0, 1]</c>.

‎test/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests/Linux/AcceptanceTest.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public Task ResourceUtilizationTracker_And_Metrics_Report_Same_Values_With_Cgrou
316316
listener.SetMeasurementEventCallback<long>((instrument,value,tags,_)
317317
=>
318318
{
319-
if(instrument.Name==ResourceUtilizationInstruments.ContainerMemoryUtilization)
319+
if(instrument.Name==ResourceUtilizationInstruments.ContainerMemoryUsage)
320320
{
321321
memoryUsageFromGauge=value;
322322
}
@@ -469,7 +469,7 @@ private static void OnInstrumentPublished(Instrument instrument, MeterListener m
469469
instrument.Name==ResourceUtilizationInstruments.ContainerCpuRequestUtilization||
470470
instrument.Name==ResourceUtilizationInstruments.ContainerCpuLimitUtilization||
471471
instrument.Name==ResourceUtilizationInstruments.ContainerMemoryLimitUtilization||
472-
instrument.Name==ResourceUtilizationInstruments.ContainerMemoryUtilization)
472+
instrument.Name==ResourceUtilizationInstruments.ContainerMemoryUsage)
473473
{
474474
meterListener.EnableMeasurementEvents(instrument);
475475
}

‎test/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests/Linux/LinuxUtilizationProviderTests.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public void Provider_Registers_Instruments()
9494
Assert.Contains(samples, x=>x.instrument.Name==ResourceUtilizationInstruments.ContainerMemoryLimitUtilization);
9595
Assert.Equal(0.5,samples.Single(i=>i.instrument.Name==ResourceUtilizationInstruments.ContainerMemoryLimitUtilization).value);
9696

97-
Assert.Contains(samples, x=>x.instrument.Name==ResourceUtilizationInstruments.ContainerMemoryUtilization);
98-
Assert.Equal(524288,samples.Single(i=>i.instrument.Name==ResourceUtilizationInstruments.ContainerMemoryUtilization).value);
97+
Assert.Contains(samples, x=>x.instrument.Name==ResourceUtilizationInstruments.ContainerMemoryUsage);
98+
Assert.Equal(524288,samples.Single(i=>i.instrument.Name==ResourceUtilizationInstruments.ContainerMemoryUsage).value);
9999

100100
Assert.Contains(samples, x=>x.instrument.Name==ResourceUtilizationInstruments.ProcessCpuUtilization);
101101
Assert.True(double.IsNaN(samples.Single(i=>i.instrument.Name==ResourceUtilizationInstruments.ProcessCpuUtilization).value));

‎test/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests/Windows/WindowsContainerSnapshotProviderTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public void SnapshotProvider_EmitsMemoryUsageMetric()
403403
varmeterFactoryMock=newMock<IMeterFactory>();
404404
meterFactoryMock.Setup(x=>x.Create(It.IsAny<MeterOptions>()))
405405
.Returns(meter);
406-
usingvarmetricCollector=newMetricCollector<long>(meter,ResourceUtilizationInstruments.ContainerMemoryUtilization,fakeClock);
406+
usingvarmetricCollector=newMetricCollector<long>(meter,ResourceUtilizationInstruments.ContainerMemoryUsage,fakeClock);
407407

408408
varoptions=newResourceMonitoringOptions
409409
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp