Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
BominRahmani committed Jan 29, 2025
1 parent b3939f1 commit 5953b43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion connector/loganomalyconnector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ func (d *Detector) processLogBatch(batch logBatch) {
}

// Add counts to current window
logCount := batch.logs.LogRecordCount()
var logCount int
if batch.logs != (plog.Logs{}) { // Check if logs is not empty
logCount = batch.logs.LogRecordCount()
}
// logCount := batch.logs.LogRecordCount()
d.counts[len(d.counts)-1] += int64(logCount)

// Check for anomalies using the fixed window counts
Expand Down

0 comments on commit 5953b43

Please sign in to comment.