use of org.neo4j.kernel.diagnostics.DiagnosticsReporterProgress 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