DocumentStoreStatsPrinter implements InventoryPrinter { @Override public void print(PrintWriter pw, Format format, boolean isZip) { if (format != Format.TEXT) { return; } DocumentStore store = nodeStore.getDocumentStore(); printTitle(pw, "DocumentStore metadata"); print(pw, store.getMetadata()); pw.println(); printTitle(pw, "DocumentStore statistics"); print(pw, store.getStats()); pw.flush(); }  @Override void print(PrintWriter pw, Format format, boolean isZip);  }
@Test public void printStats() { DocumentNodeStore ns = builderProvider.newBuilder().getNodeStore(); DocumentStoreStatsPrinter printer = new DocumentStoreStatsPrinter(); printer.nodeStore = ns; StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); printer.print(pw, Format.TEXT, false); List<String> lines = asList(sw.toString().split("\\r?\\n")); assertThat(lines, hasItem("type=memory")); assertThat(lines, hasItem("nodes=1")); assertThat(lines, hasItem("clusterNodes=1")); }