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

omit pause container network metrics #2836

Merged
merged 1 commit into from
Mar 30, 2021
Merged

omit pause container network metrics #2836

merged 1 commit into from
Mar 30, 2021

Conversation

sharanyad
Copy link
Contributor

Summary

For awsvpc network mode, we obtain the network metrics of the task's network interface and divide that equally among other containers in the task excluding the pause container

numberOfContainers := len(task.Containers) - 1

But it was observed that pause container was still included in the final network metrics calculation leading to incorrect total task's network stats.
This PR fixes it.

Implementation details

do not add network stats to the container if its the pause container

Testing

manual testing:

before changes:

ContainerName: "~internal~ecs~pause",
          CpuStatsSet: {
            Max: 0,
            Min: 0,
            SampleCount: 20,
            Sum: 0
          },
          MemoryStatsSet: {
            Max: 0,
            Min: 0,
            SampleCount: 20,
            Sum: 0
          },
          NetworkStatsSet: {
            RxBytes: {
              Max: 1558,
              Min: 1438,
              OverflowMax: 0,
              OverflowMin: 0,
              OverflowSum: 0,
              SampleCount: 14,
              Sum: 21212
            },
            RxBytesPerSecond: {
              Max: 5.999998092651367,
              Min: 0,
              SampleCount: 13,
              Sum: 11.999961853027344
            },
            RxDropped: {
              Max: 0,
              Min: 0,
              OverflowMax: 0,
              OverflowMin: 0,
              OverflowSum: 0,
              SampleCount: 14,
              Sum: 0
            },
.....

after changes:

ContainerName: "~internal~ecs~pause",
          CpuStatsSet: {
            Max: 0,
            Min: 0,
            SampleCount: 20,
            Sum: 0
          },
          MemoryStatsSet: {
            Max: 0,
            Min: 0,
            SampleCount: 20,
            Sum: 0
          },
          StorageStatsSet: {
            ReadSizeBytes: {
              Max: 0,
.....

New tests cover the changes: yes

Description for the changelog

Bug - Fix task's network stats by omitting pause container in the network metrics calculation.

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sharanyad sharanyad merged commit 4e0a8b9 into aws:dev Mar 30, 2021
@shubham2892 shubham2892 added this to the 1.51.0 milestone Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants