Skip to content

Commit

Permalink
Add the appserver startup Epoch Seconds to the currentlyDisconnected
Browse files Browse the repository at this point in the history
PV's report
  • Loading branch information
slacmshankar committed Jun 10, 2017
1 parent 0252df4 commit 3336359
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ public enum WAR_FILE { MGMT, RETRIEVAL, ETL, ENGINE }
*/
public boolean isStartupComplete();

/**
* Get an approximate time in epoch seconds when the appserver started up.
* @return
*/
public long getTimeOfAppserverStartup();

/**
* The name/path of the archappl.properties file.
* By default, we look for archappl.properties in the webapp's classpath - this will typically resolve into WEB-INF/classes of the webapp.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ public ExecutePolicy load(String key) throws IOException {


private ServletContext servletContext;

private long appserverStartEpochSeconds = TimeUtils.getCurrentEpochSeconds();

protected DefaultConfigService() {
// Only the unit tests config service uses this constructor.
Expand Down Expand Up @@ -1994,4 +1996,10 @@ public void setNamedFlag(String name, boolean value) {
public Set<String> getNamedFlagNames() {
return namedFlags.keySet();
}

@Override
public long getTimeOfAppserverStartup() {
return this.appserverStartEpochSeconds;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public void execute(HttpServletRequest req, HttpServletResponse resp, ConfigServ
pvStatus.put("instance", identity);
pvStatus.put("lastKnownEvent", TimeUtils.convertToHumanReadableString(pvMetrics.getSecondsOfLastEvent()));
long connectionLastLostEpochSeconds = pvMetrics.getConnectionLastLostEpochSeconds();
pvStatus.put("connectionLostAt", connectionLastLostEpochSeconds > 0 ? TimeUtils.convertToHumanReadableString(connectionLastLostEpochSeconds) : "N/A");
pvStatus.put("connectionLostAt", connectionLastLostEpochSeconds > 0 ? TimeUtils.convertToHumanReadableString(connectionLastLostEpochSeconds) : TimeUtils.convertToHumanReadableString(configService.getTimeOfAppserverStartup()));
pvStatus.put("noConnectionAsOfEpochSecs", Long.toString(connectionLastLostEpochSeconds > 0 ? connectionLastLostEpochSeconds : configService.getTimeOfAppserverStartup()));
String hostName = channel.getHostName();
pvStatus.put("hostName", hostName != null ? hostName : "N/A");
pvStatus.put("commandThreadID", Integer.toString(channel.getJCACommandThreadID()));
Expand Down

0 comments on commit 3336359

Please sign in to comment.