Git Product home page Git Product logo

graphite-stresser's Introduction

Stresser

The Stresser application will publish a fixed amount of metrics to the carbon-cache regularly. It uses the Coda Hale metrics library internally and more specifically, it uses a Timer object to collect data. The Stresser receives a couple of parameters:

  • Graphite host: in our case, the server housing our carbon cache
  • Graphite port: in our case, the carbon cache port
  • Number of hosts: to simulate publishing from
  • Number of timers: each timer generates 15 distinct metrics
  • Publishing interval
  • Debug mode: true/false - logs the metrics that are published

You can run the Stresser using the following command:

Usage:

java -jar graphite-stresser.jar host port numHosts numTimers interval debug

	host: the Graphite endpoint
	port: the Graphite port
	numHosts: the number of hosts to simulate publishing from
	numTimers: the number of timers to create (options: [1, 2, 3, 4, 5, 10, 20, 64, 128, 256, 384, 650, 975, 1956, 3912, 4887, 7824, 9780, 13699])
	interval: the metric publishing interval (i.e. 10 seconds)
	debug: true/false to enable/disable debug mode
$ java -jar graphite-stresser.jar localhost 2003 1 128 10 true
Initializing 128 timers - publishing 1920 metrics every 10 seconds from 1 host(s)
Publishing metric: STRESS.host.ip-0.com.graphite.stresser.a
Publishing metric: STRESS.host.ip-0.com.graphite.stresser.ab
Publishing metric: STRESS.host.ip-0.com.graphite.stresser.abc
Publishing metric: STRESS.host.ip-0.com.graphite.stresser.abcd
...

The Coda Hale metrics library generates 15 distinct metrics per timer:

#ls -l /opt/graphite/storage/whisper/STRESS/host/ip-0/com/graphite/stresser/feg/
total 300
-rw-r--r--. 1 root root 17308 Jun  4 11:22 count.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 m15_rate.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 m1_rate.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 m5_rate.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 max.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 mean_rate.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 mean.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 min.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 p50.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 p75.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 p95.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 p98.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 p999.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 p99.wsp
-rw-r--r--. 1 root root 17308 Jun  4 11:22 stddev.wsp

Simulate Multiple Hosts

If you need to simulate reporting the same set of metrics from different hosts, you can modify the numHosts parameter. In this example, the application will initialize 10 timers are report the metrics from 5 different hosts:

$ java -jar graphite-stresser.jar localhost 2003 5 10 10 true
Initializing 10 timers - publishing 750 metrics every 10 seconds from 5 host(s)
Publishing metric: STRESS.host.ip-0.com.graphite.stresser.a
Publishing metric: STRESS.host.ip-1.com.graphite.stresser.a
Publishing metric: STRESS.host.ip-2.com.graphite.stresser.a
Publishing metric: STRESS.host.ip-3.com.graphite.stresser.a
Publishing metric: STRESS.host.ip-4.com.graphite.stresser.a
Publishing metric: STRESS.host.ip-0.com.graphite.stresser.b
Publishing metric: STRESS.host.ip-1.com.graphite.stresser.b
Publishing metric: STRESS.host.ip-2.com.graphite.stresser.b
Publishing metric: STRESS.host.ip-3.com.graphite.stresser.b
Publishing metric: STRESS.host.ip-4.com.graphite.stresser.b
...

Building

Building the jar is done through Gradle:

$ ./gradlew uberjar

The built executable jar is now located at build/libs

You can also build a docker image:

$ ./gradlew buildDocker
$ docker images | grep graphite
banno/graphite-stresser                                0.1                 dcdaf3514818        4 minutes ago       310.6 MB

Docker

If you would like to just run with docker:

$ docker run -it banno/graphite-stresser:0.1
Usage:

java -jar stresser.jar host port numHosts numTimers interval debug

        host: the Graphite endpoint
        port: the Graphite port
        numHosts: the number of hosts to simulate publishing from
        numTimers: the number of timers to create (options: [1, 2, 3, 4, 5, 10, 20, 64, 128, 256, 384, 650, 975, 1956, 3912, 4887, 7824, 9780, 13699])
        interval: the metric publishing interval (i.e. 10 seconds)
        debug: true/false to enable/disable debug mode

More Information

See the Stress Testing Carbon Caches blog post for more details.

graphite-stresser's People

Contributors

daks avatar feangulo avatar sherzberg avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.