From bb73b8f573a2a862b9a8fab29173ea52e4ef1004 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 11 Dec 2024 19:28:01 -0500 Subject: [PATCH] fixing ling --- .../handler/stats/provider/statuscode.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/extension/agenthealth/handler/stats/provider/statuscode.go b/extension/agenthealth/handler/stats/provider/statuscode.go index f0102642b3..de3460e860 100644 --- a/extension/agenthealth/handler/stats/provider/statuscode.go +++ b/extension/agenthealth/handler/stats/provider/statuscode.go @@ -1,3 +1,6 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: MIT + package provider import ( @@ -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" ) @@ -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 { @@ -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() @@ -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, } } @@ -159,4 +163,4 @@ func (h *StatusCodeHandler) ID() string { func (h *StatusCodeHandler) Position() awsmiddleware.HandlerPosition { return awsmiddleware.After -} \ No newline at end of file +}