Skip to content

ArrayIndexOutOfBoundsException when re-using MetricBuilder in multiple threads #70

Description

@martin-g

I reuse the same MetricBuilder to collect a batch/bulk of Metrics before sending them thru the wire but it failed with:

java.lang.ArrayIndexOutOfBoundsException: 887
        at java.util.ArrayList.add(ArrayList.java:463)
        at org.kairosdb.client.builder.MetricBuilder.addMetric(MetricBuilder.java:68)

So it seems MetricBuilder is not prepared to be used in multi-threaded environment.

Are there any recommendations how to do this ?
My application does monitoring.monitor("measurement", value, tags) all over the place. I don't want to make single HTTP call for all of them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions