System helper methods
| Type Params | Return Type | Name and description |
|---|---|---|
|
static java.lang.String |
fmtDate(long dateInMillis, java.util.TimeZone tz = null)Given a timestamp as epoch time convert to a string representation using the DATE_FORMAT |
|
static java.lang.String |
fmtDate(java.util.Date date, java.util.TimeZone tz = null)Given a java.util.Date object convert to a string representation according the DATE_FORMAT |
|
static int |
getAvailCpus()@return The number of CPUs available |
|
static MemoryUnit |
getAvailDisk()@return The actual free space in the node local storage |
|
static MemoryUnit |
getAvailMemory()@return The total system memory available |
|
static long |
getBootTimeMillis() |
|
static java.lang.String |
getBootTimeString() |
|
static java.lang.String |
getHostName()@return The system host name |
|
static Duration |
getUptimeDuration()The system uptime |
|
static java.lang.String |
getUptimeText()Read the system uptime as returned by the uptime Linux tool |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Given a timestamp as epoch time convert to a string representation using the DATE_FORMAT
dateInMillis
- The date as number of milliseconds from 1 Jan 1970tz
- The java.util.TimeZone to use to format the date, or null to use the default time-zoneGiven a java.util.Date object convert to a string representation according the DATE_FORMAT
date
- The date to render as a stringtz
- The java.util.TimeZone to use to format the date, or null to use the default time-zone
The system uptime
Read the system uptime as returned by the uptime Linux tool
uptime command return a non-zero exit statusuptime stdout text