use of org.neo4j.kernel.diagnostics.providers.StoreFilesDiagnostics in project neo4j by neo4j.
the class KernelDiagnosticsIT method shouldIncludeNativeIndexFilesInTotalMappedSize.
@Test
void shouldIncludeNativeIndexFilesInTotalMappedSize() {
for (GraphDatabaseSettings.SchemaIndex schemaIndex : GraphDatabaseSettings.SchemaIndex.values()) {
// given
Neo4jLayout layout = neo4jLayout;
createIndexInIsolatedDbInstance(layout.homeDirectory(), schemaIndex);
// when
DatabaseLayout databaseLayout = layout.databaseLayout(DEFAULT_DATABASE_NAME);
StorageEngineFactory storageEngineFactory = StorageEngineFactory.defaultStorageEngine();
StoreFilesDiagnostics files = new StoreFilesDiagnostics(storageEngineFactory, fs, databaseLayout);
SizeCapture capture = new SizeCapture();
files.dump(capture::log);
assertNotNull(capture.size);
// then
long expected = manuallyCountTotalMappedFileSize(databaseLayout.databaseDirectory());
assertEquals(bytesToString(expected), capture.size);
}
}
use of org.neo4j.kernel.diagnostics.providers.StoreFilesDiagnostics in project neo4j by neo4j.
the class KernelDiagnosticsOfflineReportProvider method listDataDirectory.
/**
* Print a tree view of all the files in the database directory with files sizes.
*
* @param sources destination of the sources.
*/
private void listDataDirectory(List<DiagnosticsReportSource> sources) {
StorageEngineFactory storageEngineFactory = StorageEngineFactory.defaultStorageEngine();
StoreFilesDiagnostics storeFiles = new StoreFilesDiagnostics(storageEngineFactory, fs, databaseLayout);
List<String> files = new ArrayList<>();
storeFiles.dump(files::add);
sources.add(DiagnosticsReportSources.newDiagnosticsString("tree.txt", () -> String.join(System.lineSeparator(), files)));
}
Aggregations