Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Commit

Permalink
Print link to debugger UI
Browse files Browse the repository at this point in the history
After successfully registering a debuggee, print a link to go to the
appropriate UI.
  • Loading branch information
bchambers authored and dhalperi committed Mar 24, 2016
1 parent 3f73932 commit 39e70e6
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,12 @@ private <T> PCollection<T> applyWindow(
return super.apply(new AssignWindows<>(transform), input);
}

private String debuggerMessage(String projectId, String uniquifier) {
return String.format("To debug your job, visit Google Cloud Debugger at: "
+ "https://console.developers.google.com/debug?project=%s&dbgee=%s",
projectId, uniquifier);
}

private void maybeRegisterDebuggee(DataflowPipelineOptions options, String uniquifier) {
if (!options.getEnableCloudDebugger()) {
return;
Expand All @@ -436,6 +442,8 @@ private void maybeRegisterDebuggee(DataflowPipelineOptions options, String uniqu
Clouddebugger debuggerClient = Transport.newClouddebuggerClient(options).build();
Debuggee debuggee = registerDebuggee(debuggerClient, uniquifier);
options.setDebuggee(debuggee);

System.out.println(debuggerMessage(options.getProject(), debuggee.getUniquifier()));
}

private Debuggee registerDebuggee(Clouddebugger debuggerClient, String uniquifier) {
Expand Down

0 comments on commit 39e70e6

Please sign in to comment.