chore: create DeleteMetricMillisBehindLatest to satisfy worker_test implementation error (#3)

Signed-off-by: Kris O'Mealy <komealy@hotmail.com>
This commit is contained in:
Kris O'Mealy 2023-04-21 06:23:14 -07:00 committed by komealy
parent b12921da23
commit 877c716d3d
No known key found for this signature in database
GPG key ID: 873394803D205A88
2 changed files with 9 additions and 1 deletions

View file

@ -298,6 +298,13 @@ func (cw *MonitoringService) MillisBehindLatest(shard string, millSeconds float6
m.behindLatestMillis = append(m.behindLatestMillis, millSeconds) m.behindLatestMillis = append(m.behindLatestMillis, millSeconds)
} }
func (cw *MonitoringService) DeleteMetricMillisBehindLatest(shard string) {
m := cw.getOrCreatePerShardMetrics(shard)
m.Lock()
defer m.Unlock()
m.behindLatestMillis = []float64{}
}
func (cw *MonitoringService) LeaseGained(shard string) { func (cw *MonitoringService) LeaseGained(shard string) {
m := cw.getOrCreatePerShardMetrics(shard) m := cw.getOrCreatePerShardMetrics(shard)
m.Lock() m.Lock()

View file

@ -338,7 +338,8 @@ func getMetricsConfig(kclConfig *cfg.KinesisClientLibConfiguration, service stri
return cloudwatch.NewMonitoringServiceWithOptions(kclConfig.RegionName, return cloudwatch.NewMonitoringServiceWithOptions(kclConfig.RegionName,
kclConfig.KinesisCredentials, kclConfig.KinesisCredentials,
kclConfig.Logger, kclConfig.Logger,
cloudwatch.DefaultCloudwatchMetricsBufferDuration) cloudwatch.DefaultCloudwatchMetricsBufferDuration,
)
} }
if service == "prometheus" { if service == "prometheus" {