-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace batch with copyFrom #18
Conversation
Michael Sjölin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @micsjo! Thank you for your contribution. Please be sure to sign the CLA. Also, since you're updating the client library, you'll need to run a go mod tidy
to update the modules.
Tidied and updated. |
@@ -146,6 +146,11 @@ func (o *Output) flushMetrics() { | |||
sampleContainers := o.GetBufferedSamples() | |||
start := time.Now() | |||
|
|||
o.logger.Debug("flushMetrics: Collecting...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove the redundant logging. The following entry provides additional context with the count, so this log is superfluous.
Extra credit: a few lines down, we have the same situation from a previous contributor. Removal of the o.logger.Debug("flushMetrics: Committing...")
would be appreciated.
o.logger.WithField("sample-containers", len(sampleContainers)).Debug("flushMetrics: Collecting...") | ||
|
||
rows := [][]interface{}{} | ||
|
||
var batch pgx.Batch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: With the metrics samples no longer using the Batch,
I'd prefer to see the original variable declaration moved just prior to the loop responsible for populating the batch (~line 166).
Signed-off-by: Paul Balogh <javaducky@gmail.com>
Remove batch for metrics. Keep for thresholds (it's just a few inserts at the beginning, no need to change)
Use copyFrom for metrics.
Update pgx from v4 to v5 and subsequent use of pgx according to docs.
Additional debug logging to know how many data containers were collected.
Fixes this issue: Issue 17