Search in sources :

Example 1 with JMXDumper

use of org.neo4j.dbms.diagnostics.jmx.JMXDumper 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);
    }
}
Also used : Path(java.nio.file.Path) JMXDumper(org.neo4j.dbms.diagnostics.jmx.JMXDumper) Config(org.neo4j.configuration.Config) DiagnosticsReporterProgress(org.neo4j.kernel.diagnostics.DiagnosticsReporterProgress) DiagnosticsReporter(org.neo4j.kernel.diagnostics.DiagnosticsReporter) IOException(java.io.IOException) CommandFailedException(org.neo4j.cli.CommandFailedException)

Aggregations

IOException (java.io.IOException)1 Path (java.nio.file.Path)1 CommandFailedException (org.neo4j.cli.CommandFailedException)1 Config (org.neo4j.configuration.Config)1 JMXDumper (org.neo4j.dbms.diagnostics.jmx.JMXDumper)1 DiagnosticsReporter (org.neo4j.kernel.diagnostics.DiagnosticsReporter)1 DiagnosticsReporterProgress (org.neo4j.kernel.diagnostics.DiagnosticsReporterProgress)1