Examples of used()


Examples of akka.cluster.StandardMetrics.HeapMemory.used()

  }

  void logHeap(NodeMetrics nodeMetrics) {
    HeapMemory heap = StandardMetrics.extractHeapMemory(nodeMetrics);
    if (heap != null) {
      log.info("Used heap: {} MB", ((double) heap.used()) / 1024 / 1024);
    }
  }

  void logCpu(NodeMetrics nodeMetrics) {
    Cpu cpu = StandardMetrics.extractCpu(nodeMetrics);
View Full Code Here

Examples of ch.akuhn.hapax.linalg.SparseVector.used()

    @Test
    public SparseVector empty() {
        SparseVector v = new SparseVector(10, 3);
        assertEquals(10, v.size());
        assertEquals(0, v.used());
        assertEquals(0, v.get(0), Double.MIN_VALUE);
        assertEquals(0, v.get(1), Double.MIN_VALUE);
        assertEquals(0, v.get(2), Double.MIN_VALUE);
        assertEquals(0, v.get(3), Double.MIN_VALUE);
        assertEquals(0, v.get(4), Double.MIN_VALUE);
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

  {
    ByteBufferPool p = new ByteBufferPool( 4096, 0, 10, 0, 0 );
    ByteBuffer b = p.alloc( null );
    assertNotNull( b );
    assertEquals( 4096, b.limit() );
    assertEquals( 1, p.used() );
    p.release( b );
    assertEquals( 0, p.used() );
  }
 
  /** @throws Exception */
 
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

    ByteBuffer b = p.alloc( null );
    assertNotNull( b );
    assertEquals( 4096, b.limit() );
    assertEquals( 1, p.used() );
    p.release( b );
    assertEquals( 0, p.used() );
  }
 
  /** @throws Exception */
  @Test
  public void alloc2() throws Exception
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

  {
    ByteBufferPool p = new ByteBufferPool( 1024, 0, 10, 0, 0 );
    ByteBuffer b = p.alloc( null );
    assertNotNull( b );
    assertEquals( 1024, b.limit() );
    assertEquals( 1, p.used() );
    p.release( b );
    assertEquals( 0, p.used() );
  }
 
  /** @throws Exception */
 
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

    ByteBuffer b = p.alloc( null );
    assertNotNull( b );
    assertEquals( 1024, b.limit() );
    assertEquals( 1, p.used() );
    p.release( b );
    assertEquals( 0, p.used() );
  }
 
  /** @throws Exception */
  @Test
  public void alloc3() throws Exception
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

    assertEquals( 2, b.length );
    assertNotNull( b[0] );
    assertEquals( 4096, b[0].limit() );
    assertNotNull( b[1] );
    assertEquals( 4096, b[1].limit() );
    assertEquals( 2, p.used() );
    p.release( b );
    assertEquals( 0, p.used() );
  }
 
  /** @throws Exception */
 
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

    assertEquals( 4096, b[0].limit() );
    assertNotNull( b[1] );
    assertEquals( 4096, b[1].limit() );
    assertEquals( 2, p.used() );
    p.release( b );
    assertEquals( 0, p.used() );
  }
 
  /** @throws Exception */
  @Test( expected = IOException.class )
  public void alloc4() throws Exception
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

  {
    // slower because of no pooling.
    ByteBufferPool p = new ByteBufferPool( 1024, 0, 1, 0, 0 );
    for (int i = 0; i < 100000; i++)
      p.release( p.alloc( null ) );
    assertEquals( 0, p.used() );
  }
 
  /** @throws Exception */
  @Test
  public void alloc6() throws Exception
View Full Code Here

Examples of etch.util.core.nio.ByteBufferPool.used()

  {
    // faster because of pooling.
    ByteBufferPool p = new ByteBufferPool( 1024, 1, 1, 0, 0 );
    for (int i = 0; i < 100000; i++)
      p.release( p.alloc( null ) );
    assertEquals( 0, p.used() );
  }
 
  /** @throws Exception */
  @Test
  public void notify1() throws Exception
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.