crawljax/crawljax — pull request #318 by alexnederlof (2013-07-17 14:37:38+00:00)
Title: Implemented statistics for Crawljax.

Implements statistics for Crawljax using [Codehale's statistics](http://metrics.codahale.com/manual/core/#man-core-reporters-slf4j). You can inject the MetricsRegistry whenever you like.

I have pre-loaded some metrics in core and there's an example. The example shows how you can print the already inserted metrics and add one of your own.

The default counters I have included are:

- Crawler lost count
- Unfired actions count
- Invocations per plugin count.

The output of the example is the standard counters plus a histogram of the DOM-size:
```
[main] INFO - type=COUNTER, name=com.crawljax.crawlevents.crawler_lost, count=0
[main] INFO - type=COUNTER, name=com.crawljax.crawlevents.unfired_actions, count=0
[main] INFO - type=COUNTER, name=com.crawljax.crawlplugins.DomChangeNotifierPlugin.invocations, count=19
[main] INFO - type=COUNTER, name=com.crawljax.crawlplugins.OnBrowserCreatedPlugin.invocations, count=1
[main] INFO - type=COUNTER, name=com.crawljax.crawlplugins.OnFireEventFailedPlugin.invocations, count=0
[main] INFO - type=COUNTER, name=com.crawljax.crawlplugins.OnInvariantViolationPlugin.invocations, count=0
[main] INFO - type=COUNTER, name=com.crawljax.crawlplugins.OnNewStatePlugin.invocations, count=17
[main] INFO - type=COUNTER, name=com.crawljax.crawlplugins.OnRevisitStatePlugin.invocations, count=1
[main] INFO - type=COUNTER, name=com.crawljax.crawlplugins.OnUrlLoadPlugin.invocations, count=15
[main] INFO - type=COUNTER, name=com.crawljax.crawlplugins.PostCrawlingPlugin.invocations, count=1
[main] INFO - type=COUNTER, name=com.crawljax.crawlplugins.PreCrawlingPlugin.invocations, count=0
[main] INFO - type=COUNTER, name=com.crawljax.crawlplugins.PreStateCrawlingPlugin.invocations, count=15
[main] INFO - type=HISTOGRAM, name=com.crawljax.examples.MetricPluginExample.domsize, count=17, min=2, max=5, mean=3.4705882352941178, stddev=0.7998161553463027, median=4.0, p75=4.0, p95=5.0, p98=5.0, p99=5.0, p999=5.0
```

Fixes #314