Metrics Generator

Library for generating metric samples.

License

License

Categories

Categories

Net Metrics Application Testing & Monitoring Monitoring Networking
GroupId

GroupId

com.arpnetworking.metrics
ArtifactId

ArtifactId

generator
Last Version

Last Version

1.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

Metrics Generator
Library for generating metric samples.
Project URL

Project URL

https://github.com/ArpNetworking/metrics-generator
Source Code Management

Source Code Management

https://github.com/arpnetworking/metrics-generator

Download generator

How to add to project

<!-- https://jarcasting.com/artifacts/com.arpnetworking.metrics/generator/ -->
<dependency>
    <groupId>com.arpnetworking.metrics</groupId>
    <artifactId>generator</artifactId>
    <version>1.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.arpnetworking.metrics/generator/
implementation 'com.arpnetworking.metrics:generator:1.3.1'
// https://jarcasting.com/artifacts/com.arpnetworking.metrics/generator/
implementation ("com.arpnetworking.metrics:generator:1.3.1")
'com.arpnetworking.metrics:generator:jar:1.3.1'
<dependency org="com.arpnetworking.metrics" name="generator" rev="1.3.1">
  <artifact name="generator" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.arpnetworking.metrics', module='generator', version='1.3.1')
)
libraryDependencies += "com.arpnetworking.metrics" % "generator" % "1.3.1"
[com.arpnetworking.metrics/generator "1.3.1"]

Dependencies

compile (9)

Group / Artifact Type Version
com.arpnetworking.logback : logback-steno jar 1.18.2
com.arpnetworking.metrics : metrics-client jar 0.11.2
com.arpnetworking.metrics.extras : file-sink-extra jar 0.11.2
com.google.guava : guava jar 25.1-jre
com.arpnetworking.commons : commons jar 1.18.3
org.apache.commons : commons-math3 jar 3.6.1
net.sf.oval : oval jar 1.90
com.github.spotbugs : spotbugs-annotations jar 4.0.3
com.google.code.findbugs : jsr305 jar 3.0.2

provided (1)

Group / Artifact Type Version
com.arpnetworking.build : build-resources jar 2.0.2

test (2)

Group / Artifact Type Version
junit : junit jar 4.13
com.fasterxml.jackson.core : jackson-databind jar 2.9.8

Project Modules

There are no modules declared in this project.

Metrics Generator

License: Apache 2 Travis Build Maven Artifact

Generates realistic-looking metrics data for use in system testing.

Usage

Integrated Library

Add Dependency

Determine the latest version of the commons in Maven Central.

Maven

Add a dependency to your pom:

<dependency>
    <groupId>com.arpnetworking.metrics</groupId>
    <artifactId>generator</artifactId>
    <version>VERSION</version>
</dependency>

The Maven Central repository is included by default.

Gradle

Add a dependency to your build.gradle:

compile group: 'com.arpnetworking.metrics', name: 'metrics', version: 'VERSION'

Add the Maven Central Repository into your build.gradle:

repositories {
    mavenCentral()
}
SBT

Add a dependency to your project/Build.scala:

val appDependencies = Seq(
    "com.arpnetworking.metrics" % "metrics" % "VERSION"
)

The Maven Central repository is included by default.

Invocation

The following function generates the specified data. Specify:

  • The number of units of work.
  • The number of unique metrics (aka names).
  • The number of samples per metric per unit of work.
public void generate(final int uowCount, final int metricsCount, final int samplesCount) {
        final RandomGenerator random = new MersenneTwister(1298); // Just pick a number as the seed.
        final Path path = Paths.get("build/tmp/perf/application-generated-sample.log");

        final DateTime start = DateTime.now().hourOfDay().roundFloorCopy();
        final DateTime stop = start.plusMinutes(10);
        final TestFileGenerator generator = new TestFileGenerator.Builder()
                .setRandom(random)
                .setUnitOfWorkCount(uowCount)
                .setNamesCount(metricsCount)
                .setSamplesCount(samplesCount)
                .setStartTime(start)
                .setEndTime(stop)
                .setFileName(path)
                .setClusterName("application_cluster")
                .setServiceName("application_service")
                .build();
        generator.generate();
}

Stand Alone Application

Installation

The metrics-generator artifacts may be installed and executed as a stand-alone application. You can find the artifacts from the build in target/appassembler/ and these should be copied to an appropriate directory on your target host(s).

Execution

There are generated scripts in target/appassembler/bin/ to run the metrics-generator: metrics-generator (Linux) and metrics-generator.bat (Windows). One of these should be executed on system start with appropriate parameters; for example:

metrics-generator> ./target/appassembler/bin/metrics-generator --continuous

Configuration

All configuration is provided on the command line.

  • By default without any arguments the metrics generator will produce a set of test files in the current directory.
  • Specifying the "--continuous" argument the generator will produce a continuous stream of metrics into a single file.

Building

Prerequisites:

  • None

Building:

metrics-generator> ./jdk-wrapper.sh ./mvnw verify

To use the local version you must first install it locally:

metrics-generator> ./jdk-wrapper.sh ./mvnw install

You can determine the version of the local build from the pom file. Using the local version is intended only for testing or development.

You may also need to add the local repository to your build in order to pick-up the local version:

  • Maven - Included by default.
  • Gradle - Add mavenLocal() to build.gradle in the repositories block.
  • SBT - Add resolvers += Resolver.mavenLocal into project/plugins.sbt.

License

Published under Apache Software License 2.0, see LICENSE

© Groupon Inc., 2014

Versions

Version
1.3.1
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.1.1
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0