Package com.bluesoft.util.metrics.core

Examples of com.bluesoft.util.metrics.core.Metric


  @Test
  public void testGetChildMeteringWrappingMetric() {
    TimingMetric mock = createMock( TimingMetric.class );
    UnitRoundingMeteringMetric rounder = new UnitRoundingMeteringMetric( TimeUnit.MINUTES, mock );
    final Metric child = new AbstractMetric( "test" ) {
    };
    expect( mock.getChild( eq( "test" ) ) ).andStubReturn( child );
    replay( mock );
    assertSame( rounder.getChild( "test" ), child );
    verify( mock );
View Full Code Here


  @Override
  public Metric getChild( String name ) throws IllegalArgumentException {
    if ( children == null ) {
      children = new HashMap<>();
    }
    Metric child = children.get( name );
    if ( child == null ) {
      Metric childMetric = delegate.getChild( name );
      if ( childMetric instanceof TimingMetric ) {
        TimeUnit timeUnit = getTimeUnit();
        if ( timeUnit == null ) {
          timeUnit = ((TimingMetric)childMetric).getTimeUnit();
        }
View Full Code Here

TOP

Related Classes of com.bluesoft.util.metrics.core.Metric

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.