version info add run time

This commit is contained in:
heavyrain2012
2021-09-20 20:44:04 +08:00
parent db25a6ae04
commit f39fd3abd5
@@ -35,6 +35,10 @@ public class GitRepositoryState {
public final String buildHost;
public final String buildVersion;
public final long runTime;
private final static long startTime = System.currentTimeMillis();
private GitRepositoryState(Properties properties) {
this.tags = String.valueOf(properties.get("git.tags"));
this.branch = String.valueOf(properties.get("git.branch"));
@@ -58,6 +62,7 @@ public class GitRepositoryState {
this.buildTime = String.valueOf(properties.get("git.build.time"));
this.buildHost = String.valueOf(properties.get("git.build.host"));
this.buildVersion = String.valueOf(properties.get("git.build.version"));
this.runTime = (System.currentTimeMillis() - startTime)/1000;
}
public static GitRepositoryState getGitRepositoryState() throws IOException {