Add hostname to buildserver/vars

We run 9-15 buildservers simultaneously and have a status page that
reports the /buildserver/vars foreach server. However it is hard to know
which status is for which buildserver. So we add the buildserver
hostname here.

Change-Id: I46fc59626cccf668ab57a5f81581273f0358fd1e
parent 6d2bed05
...@@ -258,6 +258,7 @@ public class BuildServer { ...@@ -258,6 +258,7 @@ public class BuildServer {
RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean(); RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();
DateFormat dateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.FULL); DateFormat dateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.FULL);
variables.put("state", getShutdownState() + ""); variables.put("state", getShutdownState() + "");
variables.put("hostname", InetAddress.getLocalHost().getHostName());
if (shuttingTime != 0) { if (shuttingTime != 0) {
variables.put("shutdown-time", dateTimeFormat.format(new Date(shuttingTime))); variables.put("shutdown-time", dateTimeFormat.format(new Date(shuttingTime)));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment