Skip to content
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

Report in bulk #38

Closed
wants to merge 3 commits into from
Closed

Report in bulk #38

wants to merge 3 commits into from

Conversation

jacktang
Copy link

@jacktang jacktang commented Mar 2, 2017

We'd like to insert meter data in InfluxDB as one record

@surik surik self-assigned this Mar 2, 2017
@surik
Copy link
Contributor

surik commented Mar 2, 2017

Hi @jacktang,

thank you for your PR.

By the way, we already have own bulk write mechanism, see batch_window_size option. Of course, using exometer_report_bulk as an additional option is not a bad idea. I will take a look on it.

fun({Metric, DataPoints}, {StateAccIn, ErrorsAccIn}) ->
case maps:get(Metric, Metrics, not_found) of
{MetricName, Tags} ->
case maybe_send(Metric, MetricName, Tags,
Copy link
Contributor

@surik surik Mar 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you notice that maybe_send has two behaviors depend on batch_window_size?
With batch_window_size=0 each metric from a bulk will be sent in an own request.
With batch_window_size>0 it isn't sent immediately but goes to a buffer to the further sending in one batch.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@surik you're right. I missed the batch_window_size config. The original code supports the report in bulk.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then I will close it

@surik surik closed this Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants