vishesh92 commented on code in PR #11670:
URL: https://github.com/apache/cloudstack/pull/11670#discussion_r2361902477
##########
server/src/main/java/com/cloud/server/StatsCollector.java:
##########
@@ -937,12 +937,12 @@ private void getProcFileSystemData(@NotNull
ManagementServerHostStatsEntry newEn
logger.info(String.format("used memory from /proc: %d",
newEntry.getSystemMemoryUsed()));
}
try {
- String bootTime = Script.runSimpleBashScript("uptime -s");
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd
hh:mm:ss", Locale.ENGLISH);
+ String bootTime = Script.runSimpleBashScript("date -d @$(grep
btime /proc/stat | awk '{print $2}') '+%Y-%m-%d %H:%M:%S'");
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd
HH:mm:ss", Locale.ENGLISH);
Review Comment:
I tested locally and the old one seems to work fine as well. But as per java
docs, it should be `HH` instead of `hh`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]