Examples of BlobStoreMetrics


Examples of org.sonatype.nexus.blobstore.api.BlobStoreMetrics

    }
  }

  @Override
  public BlobStoreMetrics getMetrics() {
    return new BlobStoreMetrics()
    {
      @Override
      public long getBlobCount() {
        return metadataStore.getBlobCount();
      }
View Full Code Here

Examples of org.sonatype.nexus.blobstore.api.BlobStoreMetrics

    assertThat("data must survive", content, is(equalTo(output)));

    final BlobMetrics metrics = blob.getMetrics();
    assertThat("size must be calculated correctly", metrics.getContentSize(), is(equalTo((long) TEST_DATA_LENGTH)));

    final BlobStoreMetrics storeMetrics = underTest.getMetrics();
    assertThat(storeMetrics.getBlobCount(), is(equalTo(1L)));

    // FIXME: This is no longer valid
    //assertThat(storeMetrics.getTotalSize(), is(equalTo((long) TEST_DATA_LENGTH)));

    assertThat(storeMetrics.getAvailableSpace(), is(greaterThan(0L)));

    final boolean deleted = underTest.delete(blob.getId());
    assertThat(deleted, is(equalTo(true)));

    final Blob deletedBlob = underTest.get(blob.getId());
    assertThat(deletedBlob, is(nullValue()));

    // Now that we've deleted the blob, there shouldn't be anything left
    final BlobStoreMetrics storeMetrics2 = underTest.getMetrics();

    // FIXME: This is no longer valid
    //assertThat(storeMetrics2.getBlobCount(), is(equalTo(0L)));
    //assertThat(storeMetrics2.getTotalSize(), is(equalTo((long) TEST_DATA_LENGTH)));

    underTest.compact();

    final BlobStoreMetrics storeMetrics3 = underTest.getMetrics();

    // FIXME: This is no longer valid
    //assertThat("compacting should reclaim deleted blobs' space", storeMetrics3.getTotalSize(), is(equalTo(0L)));
  }
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.