Package org.apache.uima.ducc.transport.event

Examples of org.apache.uima.ducc.transport.event.NodeMetricsUpdateDuccEvent


    }
   
      logger.info(methodName, null, "... Agent "+node.getNodeIdentity().getName()+" Posting Users:"+
              node.getNodeMetrics().getNodeUsersMap().size());
     
      NodeMetricsUpdateDuccEvent event = new NodeMetricsUpdateDuccEvent(node,agent.getInventoryRef().size());
      exchange.getIn().setBody(event, NodeMetricsUpdateDuccEvent.class);

    } catch( Exception e) {
      e.printStackTrace();
    }
View Full Code Here


          node.getNodeMetrics().getNodeUsersMap().size());
      // Check if swap free is less than defined minimum threshold (check ducc.properties)
      if ( swapThreshold > 0 && ( node.getNodeMetrics().getNodeMemory().getSwapFree() < swapThreshold)) {
        agent.killProcessDueToLowSwapSpace(swapThreshold);
      }
      NodeMetricsUpdateDuccEvent updateEvent = new NodeMetricsUpdateDuccEvent(node,agent.getInventoryRef().size());
      e.getIn().setBody(updateEvent, NodeMetricsUpdateDuccEvent.class);

      //  Add header property which will allow the agent to filter in its pings
//      Map<String, Object> headers = new HashMap<String, Object>();
//      headers.put(agent.configurationFactory.agentPingSelectorName,
View Full Code Here

  }
 
  public void put(DatedNodeMetricsUpdateDuccEvent duccEvent) {
    String location = "put";
    MachineSummaryInfo msi = new MachineSummaryInfo();
    NodeMetricsUpdateDuccEvent nodeMetrics = duccEvent.getNodeMetricsUpdateDuccEvent();
    Ip ip = new Ip(nodeMetrics.getNodeIdentity().getIp().trim());
    TreeMap<String, NodeUsersInfo> map = nodeMetrics.getNodeUsersMap();
    if(map != null) {
      ipToNodeUsersInfoMap.put(ip.toString(), map);
    }
    String machineName = nodeMetrics.getNodeIdentity().getName().trim();
    ipToNameMap.put(ip.toString(),machineName);
    nameToIpMap.put(machineName,ip.toString());
    double dval = nodeMetrics.getNodeMemory().getMemTotal();
    long lval = (long) (dval/(1024*1024)+0.5);
    msi.memoryTotal = lval;
    msi.sharesTotal = lval/shareSize;
    String memTotal = ""+lval/*+memUnits*/;
    String sharesTotal = ""+lval/shareSize;
    // swap: in-use
    double dvalT = nodeMetrics.getNodeMemory().getSwapTotal();
    long lvalT = (long) (dvalT/(1024*1024)+0.5);
    double dvalF= nodeMetrics.getNodeMemory().getSwapFree();
    long lvalF = (long) (dvalF/(1024*1024)+0.5);
    lval = lvalT - lvalF;
    String memSwap = ""+lval/*+memUnits*/;
    msi.memorySwapped = lval;
    String swapKey = ip.toString();
    String swapVal = ip.toString();
    if(msi.memorySwapped > 0) {
      isSwapping.put(swapKey, swapVal);
    }
    else {
      isSwapping.remove(swapKey);
    }
    String sharesInuse = "0";
    Properties shareMap = getShareMap(shareSize);
    try {
      if(shareMap.containsKey(ip.toString())) {
        msi.sharesInuse += (Integer)shareMap.get(ip.toString());
        sharesInuse = ""+msi.sharesInuse;
      }
    }
    catch(Throwable t) {
      logger.warn(location, jobid, t);
    }
    List<ProcessInfo> alienPids = nodeMetrics.getRogueProcessInfoList();
    MachineInfo current = new MachineInfo("", ip.toString(), machineName, memTotal, memSwap, alienPids, sharesTotal, sharesInuse, duccEvent.getMillis(), duccEvent.getEventSize());
    String key = normalizeMachineName(machineName);
    MachineInfo previous = unsortedMachines.get(key);
    if(previous != null) {
      long pHbMax = previous.getHeartbeatMax();
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.transport.event.NodeMetricsUpdateDuccEvent

Copyright © 2018 www.massapicom. 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.