Skip to content

Commit

Permalink
kubelet reporter plugin support report numa memory bandwidth allocata…
Browse files Browse the repository at this point in the history
…ble/capacity and allocation
  • Loading branch information
luomingmeng committed Apr 7, 2024
1 parent 4e3e5ff commit 9e67c15
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/metaserver/spd/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,12 @@ func (m *serviceProfilingManager) ServiceAggregateMetrics(ctx context.Context, p
return nil, err
}

var errList []error
for _, metrics := range spd.Status.AggMetrics {
if metrics.Aggregator != podAggregator {
continue
}

containerAggregatedMetrics := make([]resource.Quantity, 0, len(metrics.Items))
aggregatedContainerMetrics := make([]resource.Quantity, 0, len(metrics.Items))
for _, podMetrics := range metrics.Items {
containerMetrics := make([]resource.Quantity, 0, len(podMetrics.Containers))
for _, containerRawMetrics := range podMetrics.Containers {
Expand All @@ -165,17 +164,17 @@ func (m *serviceProfilingManager) ServiceAggregateMetrics(ctx context.Context, p

metric, err := util.AggregateMetrics(containerMetrics, containerAggregator)
if err != nil {
errList = append(errList, err)
return nil, err
}

if metric != nil {
containerAggregatedMetrics = append(containerAggregatedMetrics, *metric)
aggregatedContainerMetrics = append(aggregatedContainerMetrics, *metric)
}
}

metric, err := util.AggregateMetrics(containerAggregatedMetrics, metricsAggregator)
metric, err := util.AggregateMetrics(aggregatedContainerMetrics, metricsAggregator)
if err != nil {
errList = append(errList, err)
return nil, err
}

if metric != nil {
Expand Down

0 comments on commit 9e67c15

Please sign in to comment.