[ agent ] [ status ] - accomplish agent status - 5
This commit is contained in:
@@ -40,7 +40,7 @@ public class AgentSystemInfo {
|
||||
ZoneId.of("UTC+8")
|
||||
)
|
||||
))
|
||||
.upTime(TimeUtils.toRelative(os.getSystemUptime()*1000))
|
||||
.upTime(TimeUtils.toRelative(os.getSystemUptime()*1000, 3))
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,14 @@ public class TimeUtils {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* https://memorynotfound.com/calculate-relative-time-time-ago-java/
|
||||
*
|
||||
* calculate relative time from now on
|
||||
* like 5 days, 3 hours, 16 minutes level 3
|
||||
*
|
||||
* */
|
||||
|
||||
private static final Map<String, Long> times = new HashMap<>(16);
|
||||
|
||||
static {
|
||||
|
||||
Reference in New Issue
Block a user