You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Kirk Lund (JIRA)" <ji...@apache.org> on 2019/03/07 00:38:00 UTC

[jira] [Resolved] (GEODE-6487) OsStatistics should use PID for the numericId

     [ https://issues.apache.org/jira/browse/GEODE-6487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kirk Lund resolved GEODE-6487.
------------------------------
       Resolution: Fixed
    Fix Version/s: 1.10.0

> OsStatistics should use PID for the numericId
> ---------------------------------------------
>
>                 Key: GEODE-6487
>                 URL: https://issues.apache.org/jira/browse/GEODE-6487
>             Project: Geode
>          Issue Type: Improvement
>          Components: statistics
>            Reporter: Kirk Lund
>            Assignee: Kirk Lund
>            Priority: Major
>             Fix For: 1.10.0
>
>
> OsStatistics (created by HostStatHelper) uses getHostSystemId() for the numericId:
> {noformat}
>   /**
>    * 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;
>   }
> {noformat}
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)