Examples of CNSWorkerStats


Examples of com.comcast.cns.model.CNSWorkerStats

      if (rows != null) {

        for (CmbRow<String, String, String> row : rows) {

          CNSWorkerStats stats = new CNSWorkerStats();
          stats.setIpAddress(row.getKey());

          if (row.getColumnSlice().getColumnByName("producerTimestamp") != null) {
            stats.setProducerTimestamp(Long.parseLong(row.getColumnSlice().getColumnByName("producerTimestamp").getValue()));
          }

          if (row.getColumnSlice().getColumnByName("consumerTimestamp") != null) {
            stats.setConsumerTimestamp(Long.parseLong(row.getColumnSlice().getColumnByName("consumerTimestamp").getValue()));
          }

          if (row.getColumnSlice().getColumnByName("jmxport") != null) {
            stats.setJmxPort(Long.parseLong(row.getColumnSlice().getColumnByName("jmxport").getValue()));
          }

          if (row.getColumnSlice().getColumnByName("mode") != null) {
            stats.setMode(row.getColumnSlice().getColumnByName("mode").getValue());
          }

          statsList.add(stats);
        }
      }

      for (CNSWorkerStats stats : statsList) {

        if (stats.getIpAddress().equals(host) && stats.getJmxPort() > 0) {

          JMXConnector jmxConnector = null;
          String url = null;

          try {

            long port = stats.getJmxPort();
            url = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi";

            JMXServiceURL serviceUrl = new JMXServiceURL(url);
            jmxConnector = JMXConnectorFactory.connect(serviceUrl, null);
View Full Code Here

Examples of com.comcast.cns.model.CNSWorkerStats

    if (rows != null) {

      for (CmbRow<String, String, String> row : rows) {

        CNSWorkerStats stats = new CNSWorkerStats();

        stats.setIpAddress(row.getKey());

        if (row.getColumnSlice().getColumnByName("producerTimestamp") != null) {
          stats.setProducerTimestamp(Long.parseLong(row.getColumnSlice().getColumnByName("producerTimestamp").getValue()));
        }

        if (row.getColumnSlice().getColumnByName("consumerTimestamp") != null) {
          stats.setConsumerTimestamp(Long.parseLong(row.getColumnSlice().getColumnByName("consumerTimestamp").getValue()));
        }

        if (row.getColumnSlice().getColumnByName("jmxport") != null) {
          stats.setJmxPort(Long.parseLong(row.getColumnSlice().getColumnByName("jmxport").getValue()));
        }

        if (row.getColumnSlice().getColumnByName("mode") != null) {
          stats.setMode(row.getColumnSlice().getColumnByName("mode").getValue());
        }

        if (row.getColumnSlice().getColumnByName("dataCenter") != null) {
          stats.setDataCenter(row.getColumnSlice().getColumnByName("dataCenter").getValue());
        }
        statsList.add(stats);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.