Giter Site home page Giter Site logo

wicket-metrics's Introduction

wicket-metrics

Painless way of adding JMX metrics to your Wicket project.

Usage

Start by addding the following Maven dependency:

<dependency>
    <groupId>com.nitorcreations</groupId>
    <artifactId>wicket-metrics</artifactId>
    <version>1.0</version>
</dependency>

After this, three types of metrics can be added:

  1. Page size
  • This will show the size (min, max, avg, etc) of each rendered page in your web app
  1. Render time
  • This will show the time (min, max, avg, etc) it too your server the render the given page
  1. Session size
  • This is a single metric that tracks the size of your Wicket session

For Page size (1) and Render time (2), example code would look something like this:

/**
 * A common base page for all your pages.
 */
public abstract class BasePage extends WebPage {

...

    @Override
    protected void onInitialize() {
        super.onInitialize();
    
        add(new PageSizeHistogramBehavior());   // (1)
        add(new TimingBehavior());              // (2)
    }
}

For the session size metric, you need to add this to your WebApplication:

public class MyApplication extends WebApplication {

    @Override
    public void init() {
        super.init();

        getRequestCycleListeners().add(new SessionSizeHistogramRequestCycleListener());
    }
}

wicket-metrics's People

Contributors

vertti avatar

Stargazers

Asterios Raptis avatar

Watchers

James Cloos avatar Asterios Raptis 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.