Package org.qi4j.api.metrics

Examples of org.qi4j.api.metrics.MetricsTimerFactory


        startTimer( metrics );
    }

    private void startTimer( MetricsProvider metrics )
    {
        MetricsTimerFactory metricsFactory = metrics.createFactory( MetricsTimerFactory.class );
        String name = "UnitOfWork Timer";
        MetricsTimer timer = metricsFactory.createTimer( getClass(), name, TimeUnit.MILLISECONDS, TimeUnit.SECONDS );
        metricsTimer = timer.start();
    }
View Full Code Here


    private Application app;

    @Override
    protected MetricsTimerFactory createMetricsTimerFactory()
    {
        return new MetricsTimerFactory()
        {
            @Override
            public MetricsTimer createTimer( Class<?> origin, String name, TimeUnit duration, TimeUnit rate )
            {
                return new YammerTimer( Metrics.newTimer( origin, name, app.name(), duration, rate ) );
View Full Code Here

    @Test
    public void givenMetricsProviderWithoutSupportForTimerWhenRequestingTimerExpectDefaultNullImplementation()
    {
        MetricsProvider underTest = new MetricsProviderAdapter();
        MetricsTimerFactory factory = underTest.createFactory( MetricsTimerFactory.class );
        MetricsTimer test = factory.createTimer( getClass(), "test", TimeUnit.MILLISECONDS, TimeUnit.DAYS );
        test.start().stop();
    }
View Full Code Here

                                    @Invocation Method method
    )
    {
        if( metrics != null )
        {
            MetricsTimerFactory factory = metrics.createFactory( MetricsTimerFactory.class );
            boolean annotated = method.getAnnotation( TimingCapture.class ) != null;
            String captureNme = getMethodName( method ) + "() ["  +( annotated ? "@" : "" ) + "TimingCapture" + "]";
            Class<?> declaringClass = method.getDeclaringClass();
            timer = factory.createTimer( declaringClass, captureNme, TimeUnit.MILLISECONDS, TimeUnit.SECONDS );
        }
    }
View Full Code Here

TOP

Related Classes of org.qi4j.api.metrics.MetricsTimerFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.