lib-cave-batching


License

License

GroupId

GroupId

com.gilt
ArtifactId

ArtifactId

lib-cave-batching_2.10
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

lib-cave-batching
lib-cave-batching
Project URL

Project URL

https://github.com/gilt/lib-cave-batching
Project Organization

Project Organization

com.gilt
Source Code Management

Source Code Management

https://github.com/gilt/lib-cave-batching.git

Download lib-cave-batching_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/com.gilt/lib-cave-batching_2.10/ -->
<dependency>
    <groupId>com.gilt</groupId>
    <artifactId>lib-cave-batching_2.10</artifactId>
    <version>1.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.gilt/lib-cave-batching_2.10/
implementation 'com.gilt:lib-cave-batching_2.10:1.0.3'
// https://jarcasting.com/artifacts/com.gilt/lib-cave-batching_2.10/
implementation ("com.gilt:lib-cave-batching_2.10:1.0.3")
'com.gilt:lib-cave-batching_2.10:jar:1.0.3'
<dependency org="com.gilt" name="lib-cave-batching_2.10" rev="1.0.3">
  <artifact name="lib-cave-batching_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.gilt', module='lib-cave-batching_2.10', version='1.0.3')
)
libraryDependencies += "com.gilt" % "lib-cave-batching_2.10" % "1.0.3"
[com.gilt/lib-cave-batching_2.10 "1.0.3"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.6
com.gilt : gfc-concurrent_2.10 jar 0.3.3
joda-time : joda-time jar 2.9.4

provided (2)

Group / Artifact Type Version
org.scoverage : scalac-scoverage-runtime_2.10 jar 1.0.4
org.scoverage : scalac-scoverage-plugin_2.10 jar 1.0.4

test (2)

Group / Artifact Type Version
org.scalatest : scalatest_2.10 jar 3.0.0
org.mockito : mockito-core jar 1.8.5

Project Modules

There are no modules declared in this project.

lib-cave-batching Build Status Coverage Status

A library that allows batching of metrics when publishing to CAVE. It requires a CAVE client, which can be downloaded from the apidoc website.

Contents and Example Usage

client.CaveBatchConfiguration

This trait must be extended to provide the configuration parameters for the batching client. There are two mandatory parameters, and four optional parameters.

  • organisationName, teamName: mandatory String parameters to specify which organisation and team to publish metrics for.

  • sendTimeout: optional FiniteDuration parameter, specifies the maximum duration after which a batch is emitted. Default is 30 seconds.

  • sendBatchSize: maximum number of metrics in a batch. Default is 100 metrics.

  • maxAttempts: number of attempts to send a batch of metrics. Default is 2. Set this to 1 if you do not need to retry.

  • retryTimeout: optional FiniteDuration parameter, specifies how long to wait between attempts. Default is 120 seconds.

val configuration = new CaveBatchConfiguration {
  override def organisationName = "gilt"
  override def teamName = "twain"
  override def sendTimeout = 10.seconds
  override def sendBatchSize = 1000
  override def maxAttempts = 5
  override def retryTimeout = 1.minute
}

client.CaveBatchClient

Simple batching of metrics for CAVE. This class gathers raw metrics together, and sends to CAVE, as batches, in a timely fashion.

he approach in this class is to collect metrics into collections, and when full, or a timer (based on the age of the first metric in the collection) expires, that batch is sent to CAVE.

A minimal runtime impact is achieved by using a single Timer, and a single thread - the timer is used simply to schedule tasks to be executed on the thread, with the thread being used for all the work (interacting with CAVE, etc.).

Note: each instance of this class builds its own batches, and delivers to CAVE individually - multiple instances will result in multiple batches, if this is so desired.

val batchClient = new CaveBatchClient(configuration, client)
...
createOrganisationMetric(metric)
createTeamMetric(metric)
...

License

Copyright 2014 Gilt Groupe, Inc.

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

com.gilt

Gilt Tech

Versions

Version
1.0.3
1.0.2
1.0.1
1.0.0
0.0.3
0.0.2
0.0.1