Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-6487

OsStatistics should use PID for the numericId

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.9.0
    • statistics
    • 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.

      Attachments

        Activity

          People

            klund Kirk Lund
            klund Kirk Lund
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: