Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
klaren committed Jul 18, 2018
1 parent 1253814 commit 01ef8bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -66,7 +66,8 @@ public class DiagnosticsReportCommand implements AdminCommand
private static final OptionalNamedArg destinationArgument =
new OptionalCanonicalPath( "to", System.getProperty( "java.io.tmpdir" ), "reports" + File.separator,
"Destination directory for reports" );
private static final String PID_KEY = "pid";
public static final String PID_KEY = "pid";
private static final long NO_PID = 0;
private static final Arguments arguments = new Arguments()
.withArgument( new OptionalListArgument() )
.withArgument( destinationArgument )
Expand Down Expand Up @@ -148,7 +149,7 @@ private static long parsePid( Args args ) throws CommandFailed
throw new CommandFailed( "Unable to parse --" + PID_KEY, e );
}
}
return 0;
return NO_PID;
}

private String getDefaultFilename() throws UnknownHostException
Expand Down Expand Up @@ -262,7 +263,7 @@ private DiagnosticsReporter createAndRegisterSources() throws CommandFailed
private void registerJMXSources( DiagnosticsReporter reporter )
{
Optional<JmxDump> jmxDump;
if ( pid == 0 )
if ( pid == NO_PID )
{
jmxDump = jmxDumper.getJMXDump();
}
Expand Down
Expand Up @@ -31,6 +31,8 @@

import org.neo4j.io.fs.FileSystemAbstraction;

import static org.neo4j.commandline.dbms.DiagnosticsReportCommand.PID_KEY;

/**
* Facilitates JMX Dump for current running Neo4j instance.
*/
Expand Down Expand Up @@ -63,7 +65,7 @@ public Optional<JmxDump> getJMXDump()
else
{
out.println( "No running instance of neo4j was found. Online reports will be omitted." );
out.println( "If neo4j is running but not detected, you can supply the process id of the running instance with --pid" );
out.println( "If neo4j is running but not detected, you can supply the process id of the running instance with --" + PID_KEY );
return Optional.empty();
}
}
Expand Down

0 comments on commit 01ef8bf

Please sign in to comment.