Skip to content

Commit

Permalink
Apply minor polish to merge request #18 given merge
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Balogh <[email protected]>
  • Loading branch information
javaducky committed Jan 17, 2023
1 parent 21ee2b5 commit 37a4e51
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions output.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,11 @@ func (o *Output) flushMetrics() {
sampleContainers := o.GetBufferedSamples()
start := time.Now()

o.logger.Debug("flushMetrics: Collecting...")
o.logger.WithField("sample-containers", len(sampleContainers)).Debug("flushMetrics: Collecting...")

rows := [][]interface{}{}

var batch pgx.Batch
for _, sc := range sampleContainers {
samples := sc.GetSamples()
o.logger.Debug("flushMetrics: Committing...")
o.logger.WithField("samples", len(samples)).Debug("flushMetrics: Writing...")

for _, s := range samples {
Expand All @@ -164,6 +160,7 @@ func (o *Output) flushMetrics() {
}
}

var batch pgx.Batch
for _, t := range o.thresholds {
for _, threshold := range t {
batch.Queue(`UPDATE thresholds SET last_failed = $1 WHERE id = $2`,
Expand Down

0 comments on commit 37a4e51

Please sign in to comment.