use of org.neo4j.kernel.diagnostics.DiagnosticsReporter in project neo4j by neo4j.
the class DiagnosticsReportCommand method createAndRegisterSources.
private DiagnosticsReporter createAndRegisterSources(Config config) {
DiagnosticsReporter reporter = new DiagnosticsReporter();
Path storeDirectory = config.get(databases_root_path);
reporter.registerAllOfflineProviders(config, storeDirectory, ctx.fs(), config.get(GraphDatabaseSettings.default_database));
// Register sources provided by this tool
reporter.registerSource("config", DiagnosticsReportSources.newDiagnosticsFile("neo4j.conf", ctx.fs(), configFile()));
reporter.registerSource("ps", runningProcesses());
// Online connection
registerJMXSources(reporter);
return reporter;
}
use of org.neo4j.kernel.diagnostics.DiagnosticsReporter in project neo4j by neo4j.
the class DiagnosticsReportCommand method execute.
@Override
public void execute() {
Config config = getConfig(configFile());
jmxDumper = new JMXDumper(config, ctx.fs(), ctx.out(), ctx.err(), verbose);
DiagnosticsReporter reporter = createAndRegisterSources(config);
if (list) {
listClassifiers(reporter.getAvailableClassifiers());
return;
}
validateClassifiers(reporter);
DiagnosticsReporterProgress progress = buildProgress();
// Start dumping
try {
if (reportDir == null) {
reportDir = Path.of(System.getProperty("java.io.tmpdir")).resolve("reports").toAbsolutePath();
}
Path reportFile = reportDir.resolve(getDefaultFilename());
ctx.out().println("Writing report to " + reportFile.toAbsolutePath());
reporter.dump(classifiers, reportFile, progress, force);
} catch (IOException e) {
throw new CommandFailedException("Creating archive failed", e);
}
}
Aggregations