Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
OsStatistics (created by HostStatHelper) uses getHostSystemId() for the numericId:
/** * Generate a systemid based off of the ip address of the host. This duplicates the common * implementation of <code>long gethostid(void) </code>. Punt on the ipv6 case and just use the * same algorithm. * * @return a psuedo unique id based on the ip address */ private static long getHostSystemId() { long id = 0L; try { InetAddress host = SocketCreator.getLocalHost(); byte[] addr = host.getAddress(); id = (addr[1] & 0xFFL) << 24 | (addr[0] & 0xFFL) << 16 | (addr[3] & 0xFFL) << 8 | (addr[2] & 0xFFL) << 0; } catch (UnknownHostException uhe) { } return id; }
I think it would be more useful to change the numericId to be the PID which will be consistent with all other statistics instances.
We could then add a new long stat to OsStatistics to contain the value of getHostSystemId() – I'm not sure this value is actually valuable when reviewing stats though.