Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented statistics for Crawljax. #318

Closed
wants to merge 6 commits into from

Conversation

alexnederlof
Copy link
Contributor

Implements statistics for Crawljax using Codehale's statistics. 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

@ghost ghost assigned amesbah Jul 17, 2013
@alexnederlof
Copy link
Contributor Author

Not ready yet...

@alexnederlof alexnederlof reopened this Jul 17, 2013

/**
* This plugins implements {@link OnNewStatePlugin} so that for every new state we can calculate
* the DOM site. It also implements the {@link PostCrawlingPlugin} allowing us the print the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: DOM site -> size

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: allowing us the print -> to print

@amesbah
Copy link
Member

amesbah commented Jul 19, 2013

Like!

@alexnederlof
Copy link
Contributor Author

Merged in 368be71

@alexnederlof alexnederlof deleted the feature/314-statistics branch July 20, 2013 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Let crawljax report statistics
2 participants