Skip to content

Commit

Permalink
[FLINK-3023][web-dashboard] Display version and commit information on…
Browse files Browse the repository at this point in the history
… Overview Page.

This closes apache#1422
  • Loading branch information
sachingoel0101 authored and rmetzger committed Dec 12, 2015
1 parent 6bd5714 commit 0f98a8e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.flink.runtime.instance.ActorGateway;
import org.apache.flink.runtime.messages.webmonitor.RequestStatusOverview;
import org.apache.flink.runtime.messages.webmonitor.StatusOverview;
import org.apache.flink.runtime.util.EnvironmentInformation;
import scala.concurrent.Await;
import scala.concurrent.Future;
import scala.concurrent.duration.FiniteDuration;
Expand All @@ -38,7 +39,10 @@
public class ClusterOverviewHandler implements RequestHandler, RequestHandler.JsonResponse {

private final FiniteDuration timeout;


private static final String version = EnvironmentInformation.getVersion();

private static final String commitID = EnvironmentInformation.getRevisionInformation().commitId;

public ClusterOverviewHandler(FiniteDuration timeout) {
this.timeout = checkNotNull(timeout);
Expand All @@ -63,6 +67,10 @@ public String handleRequest(Map<String, String> params, ActorGateway jobManager)
gen.writeNumberField("jobs-finished", overview.getNumJobsFinished());
gen.writeNumberField("jobs-cancelled", overview.getNumJobsCancelled());
gen.writeNumberField("jobs-failed", overview.getNumJobsFailed());
gen.writeStringField("flink-version", version);
if (!commitID.equals(EnvironmentInformation.UNKNOWN)) {
gen.writeStringField("flink-commit", commitID);
}
gen.writeEndObject();

gen.close();
Expand Down
6 changes: 6 additions & 0 deletions flink-runtime-web/web-dashboard/app/partials/overview.jade
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
.navbar-title
| Overview

.navbar-info.last.first
| Version: {{overview['flink-version']}}

.navbar-info.last.first(ng-if="overview['flink-commit']")
| Commit: {{overview['flink-commit']}}

#content-inner
.row
.col-md-6
Expand Down
2 changes: 2 additions & 0 deletions flink-runtime-web/web-dashboard/web/partials/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<nav class="navbar navbar-default navbar-fixed-top navbar-main">
<div id="fold-button" ng-click="showSidebar()" class="btn btn-default navbar-btn pull-left"><i class="fa fa-navicon"></i></div>
<div class="navbar-title">Overview</div>
<div class="navbar-info last first">Version: {{overview['flink-version']}}</div>
<div ng-if="overview['flink-commit']" class="navbar-info last first">Commit: {{overview['flink-commit']}}</div>
</nav>
<div id="content-inner">
<div class="row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class EnvironmentInformation {

private static final Logger LOG = LoggerFactory.getLogger(EnvironmentInformation.class);

private static final String UNKNOWN = "<unknown>";
public static final String UNKNOWN = "<unknown>";

/**
* Returns the version of the code as String. If version == null, then the JobManager does not run from a
Expand Down

0 comments on commit 0f98a8e

Please sign in to comment.