[
https://issues.apache.org/jira/browse/GEODE-6487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16787214#comment-16787214
]
ASF subversion and git services commented on GEODE-6487:
--------------------------------------------------------
Commit a14ff0d23260d328893ad75b0e5493eb5ec811d0 in geode's branch
refs/heads/feature/GEODE-6459 from Kirk Lund
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=a14ff0d ]
GEODE-6487: Use PID for OsStatistics numericId
Cleanup HostStatHelper.
> 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)