GitXplorerGitXplorer
b

pillage

public
10 stars
2 forks
1 issues

Commits

List of commits on branch master.
Unverified
05937bc9d1b8ad4b91da5e3c5eb41331aefa2e90

asdf

committed 11 years ago
Unverified
9e3fb3582ebcf0ff85804488a4c73e39fdcc11f5

took out println and removed diff calc from gauges. upped to 0.3.17

committed 13 years ago
Unverified
8cc85b64c2ee0166b12ed2b937bfca2a8713878d

round to 2 sig figs in gmetric stats reporter

committed 13 years ago
Unverified
7a98085630f6f7e4af3fb1e79e22c7e61c3e5867

more small changes to gmetric reporter

committed 13 years ago
Unverified
73b12d1b207ca2395073e2e4140d19bf0ea2f9f2

removed spood from gmetric stats reporter

committed 13 years ago
Unverified
f35817b09d336f5bf82a5c33c3050ae643a65dcc

fixed math error in jvm stats. upped version to 0.3.12

committed 13 years ago

README

The README file for this repository.

Pillage

A super lightweight stats and monitoring lib for the jvm. It provides counters, metrics, timers, labels, gauges and jvm stats. The goals are to be lightweight, fast, make good use of resources and be flexible enough to easily hack on pieces when needed.

The library was put together by pillaging a number of other open source libs ( hence the name ) for their good parts and ideas then mixing them together with some new code and ideas.

Libraries pillaged thus far:

Components

Counters

Counters just count things. They can be incremented, read and reset.

Metrics

Metrics are tracked with a Distribution. The the only current implementation is based on the Histogram in the Ostrich scala lib. It provides max, min, mean within 5% and percentiles.

Labels

Labels are just string values. This also came from Ostrich and can be used to set flags instead of holding statistical value.

Gauges

Gauges are methods that can be functions that are executed when the stat is collected to get an reading at that instance.

StatsSummary

A StatsSummary contains Counters, Metrics and Labels for a set amount of time. A summary is an immutable object and will throw exceptions if you try to mess with it.

StatsContainer

A StatsContainer is the client interface to interact with Pillage. Through this interface you can increment counters, add metrics, set labels, acquire summaries, etc.

StatsCollector

The StatsCollector interface is used to collect stats from the container for purposes of reporting or aggregation. A collector will cache a set of stats from a StatsSummary and when the collect() method is called, it will acquire a new StatsSummary object and calculate the diff between the cached version and the new version and return that diff as a new StatsSummary object. The collect() method is how you can see change over time which is good for graphing.

The stats collector provides the option to include jvm stats which is off by default. If this option is turned on then stats from the MBeans provided with java will be included the StatsSummarys. This is a good way to get heap usage, threads counts, classes loaded/unloaded, gc counts etc without having to mess with JMX.

A stats collector can have listeners attached called StatsReporters that will receive the delta StatsSummary when collect() is called.

StatsReporter

A StatsReporter has just one method report that takes in a StatsSummary. There is currently one implementation, GangliaStatsReporter which will send the stats to a Ganlgia server over UDP.

PeriodicStatsCollector

This is a utility singleton that can be used to schedule regular calls to collect() for a given StatsCollector.

Wrapper Projects

There are two wrapper projects that provide some groovy and scala syntax sugar. They allow timing with closures and registering gauges with out having to use the Gauge interface.


TODO

  • create some other reporters ( logging, graphite )
  • make calls to report() non blocking. A call to report will most likely involve IO so if it hangs I don't want it to cause a backup or other bad things.
  • add gauges through reflection. This is a really cool feature in Ostrich but since java doesn't have closures it is a bit more difficult to implement.
  • standardize the stats naming, I think it is a bit all over the place right now.
  • enable PeriodicStatsCollector to be restarted. Right now if the thread dies the app will have to be restarted to work on reporting.
  • try alternate metric backings. Histogram is cool but I would like to collect some other things like stddev, skew etc.
  • Profiled annotation like Perf4js
  • get some production usage and iterate!