Skip to content

Commit

Permalink
fixing ling
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramadon committed Dec 12, 2024
1 parent 6dc1193 commit bb73b8f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions extension/agenthealth/handler/stats/provider/statuscode.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT

package provider

import (
Expand All @@ -7,6 +10,7 @@ import (
"time"

"github.com/amazon-contributing/opentelemetry-collector-contrib/extension/awsmiddleware"

"github.com/aws/amazon-cloudwatch-agent/extension/agenthealth/handler/stats/agent"
)

Expand All @@ -27,7 +31,7 @@ type StatusCodeProvider struct {
statusCodeChan chan statusCodeEntry
stopChan chan struct{}
resetTicker *time.Ticker
completedStats chan agent.Stats // Changed to agent.Stats
completedStats chan agent.Stats
}

type statusCodeEntry struct {
Expand All @@ -40,8 +44,8 @@ func GetStatusCodeStatsProvider() *StatusCodeProvider {
provider := &StatusCodeProvider{
currentStats: make(map[string]*[5]int),
statusCodeChan: make(chan statusCodeEntry, 1000),
stopChan: make(chan struct{}),
resetTicker: time.NewTicker(statusResetInterval),
stopChan: make(chan struct{}),
resetTicker: time.NewTicker(statusResetInterval),
completedStats: make(chan agent.Stats, 1), // buffered channel
}
provider.startProcessing()
Expand Down Expand Up @@ -129,13 +133,13 @@ func (sp *StatusCodeProvider) Stats(_ string) agent.Stats {

type StatusCodeHandler struct {
StatusCodeProvider *StatusCodeProvider
filter agent.OperationsFilter
filter agent.OperationsFilter
}

func NewStatusCodeHandler(provider *StatusCodeProvider, filter agent.OperationsFilter) *StatusCodeHandler {
return &StatusCodeHandler{
StatusCodeProvider: provider,
filter: filter,
filter: filter,
}
}

Expand All @@ -159,4 +163,4 @@ func (h *StatusCodeHandler) ID() string {

func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition {
return awsmiddleware.After
}
}

0 comments on commit bb73b8f

Please sign in to comment.