ResourceUtilization is for VM instead of POD in cosmic #5495
Labels
area-resourcemonitoring
bug
This issue describes a behavior which is not expected - a bug.
untriaged
Description
when I ran this code in cosmic, the resource I got is for the VM instead of the Pod. I tried both latest version of IResourceUtilizationTracker and IResourceMonitor.
what I got is like this:
L:Information | Resource Monitoring is running inside a Job Object. For more information about Job Objects see
https://aka.ms/job-objects
L:Debug | System resources information: CpuLimit = 32, CpuRequest = 32, MemoryLimit = 137438482432, MemoryRequest = 137438482432.
but actually, our configuration for Pod in cosmic is: CPU limit = 5, and MemoryRequest is 28Gi.
For met, this package does not work at all. Or anything I am missing? please help to check.
Reproduction Steps
My code:
register service:
serviceCollection.AddResourceMonitoring(builder =>
builder.ConfigureMonitor(options =>
{
options.CpuConsumptionRefreshInterval = TimeSpan.FromSeconds(30);
options.MemoryConsumptionRefreshInterval = TimeSpan.FromSeconds(30);
options.SamplingInterval = TimeSpan.FromSeconds(10);
options.CollectionWindow = TimeSpan.FromSeconds(600);
}));
get utilization:
IResourceMonitor monitor = Hosting.HostInstance.Services.GetService();
return monitor?.GetUtilization(TimeSpan.FromMinutes(5));
Expected behavior
expected: CpuLimit = 5, CpuRequest = 5, MemoryLimit = 28G, MemoryRequest = 28G
Actual behavior
CpuLimit = 32, CpuRequest = 32, MemoryLimit = 137438482432, MemoryRequest = 137438482432
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: