Package org.apache.uima.ducc.common.node.metrics

Examples of org.apache.uima.ducc.common.node.metrics.ProcessGarbageCollectionStats


    JMXServiceURL url = new JMXServiceURL(process.getProcessJmxUrl());
    JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
    return jmxc.getMBeanServerConnection();
  }
  public ProcessGarbageCollectionStats collect() {
    ProcessGarbageCollectionStats gcStats =
              new ProcessGarbageCollectionStats();
    if ( connection != null) {
     
      try {
        Set<ObjectInstance> mbeans=
                connection.queryMBeans(new ObjectName("java.lang:type=GarbageCollector,*"),null );
        Long totalCollectionCount= new Long(0);
        Long totalCollectionTime=new Long(0);
       
        for( ObjectInstance gcObject : mbeans) {
          String gcCollectorName = gcObject.getObjectName().getCanonicalKeyPropertyListString();
          ObjectName memoryManagerMXBean =
                  new ObjectName("java.lang:" + gcCollectorName);
          totalCollectionCount =+ (Long) connection.getAttribute(memoryManagerMXBean,"CollectionCount");
          totalCollectionTime =+ (Long) connection.getAttribute(memoryManagerMXBean,"CollectionTime");
        }
        // Returns the total number of collections that have occurred.
        gcStats.setCollectionCount(totalCollectionCount);
        // Returns the approximate accumulated collection elapsed time in milliseconds.
        gcStats.setCollectionTime(totalCollectionTime);

       
      } catch( Exception e) {
        logger.error("", null, "Failed to Fetch JMX GC Stats From PID:"+process.getPID()+" Reason:\n"+e);
      }
View Full Code Here


  public void copyInventoryGCStats(IDuccWork dw, IDuccProcess inventoryProcess, IDuccProcess process) {
    String methodName = "copyInventoryGCStats";
    logger.trace(methodName, null, messages.fetch("enter"));
    DuccId jobId = dw.getDuccId();
    DuccId processId = process.getDuccId();
    ProcessGarbageCollectionStats newGCS = inventoryProcess.getGarbageCollectionStats();
    ProcessGarbageCollectionStats oldGCS = process.getGarbageCollectionStats();
    if(validateGCStats(jobId,processId,newGCS,oldGCS)) {
      process.setGarbageCollectionStats(newGCS);
      ProcessGarbageCollectionStats gcs = process.getGarbageCollectionStats();
      if(gcs != null) {
        logger.trace(methodName, jobId, processId, "GC Stats Count:"+gcs.getCollectionCount());
        logger.trace(methodName, jobId, processId, "GC Stats Time:"+gcs.getCollectionTime());
      }
    }
    logger.trace(methodName, null, messages.fetch("exit"));
    return;
  }
View Full Code Here

        }
        // Publish resident memory
        process.setResidentMemory((totalRss * blockSize));
        //  dont collect GC metrics for POPs. May not be java or may not be a jmx enabled java process
        if ( !process.getProcessType().equals(ProcessType.Pop)) {
            ProcessGarbageCollectionStats gcStats = gcStatsCollector.collect();
            process.setGarbageCollectionStats(gcStats);
            logger.info(
                    "process",
                    null,
                    "PID:" + process.getPID() + " Total GC Collection Count :"
                            + gcStats.getCollectionCount() + " Total GC Collection Time :"
                            + gcStats.getCollectionTime());
        }

      } catch (Exception ex) {
        logger.error("process", null, e);
        ex.printStackTrace();
View Full Code Here

        long max_swap_usage = idp.getSwapUsageMax();
        long cpu_time = idp.getCpuTime();
       
        long init_time = idp.getTimeWindowInit().getElapsedMillis();

        ProcessGarbageCollectionStats gcStats = idp.getGarbageCollectionStats();
                long gcCollectionCount = 0;
                long gcCollectionTime = 0;
                if ( gcStats != null ) {
                    gcCollectionCount = gcStats.getCollectionCount();
                    gcCollectionTime = gcStats.getCollectionTime();
                }
       
        IDuccProcessWorkItems idpw = idp.getProcessWorkItems();
                long wiDispatch = 0;
                long wiDone     = 0;
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.common.node.metrics.ProcessGarbageCollectionStats

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.