Package org.apache.uima.aae.monitor.statistics

Examples of org.apache.uima.aae.monitor.statistics.LongNumericStatistic


      Monitor monitor = controller.getMonitor();
      Statistic statistic = null;
     
      if ((statistic = monitor.getStatistic(endpoint, aThresholdToCheck)) == null)
      {
        statistic = new LongNumericStatistic(aThresholdToCheck);
        monitor.addStatistic(endpoint, statistic);
      }
      if ( Monitor.GetMetaErrorRetryCount.equals(aThresholdToCheck) || Monitor.ProcessErrorRetryCount.equals(aThresholdToCheck))
      {
        return aThreshold.maxRetriesExceeded(((LongNumericStatistic)statistic).getValue());
View Full Code Here


  protected synchronized void incrementStatistic(Monitor aMonitor, String aComponentName, String aStatistic)
  {
    Statistic statistic = aMonitor.getStatistic(aComponentName, aStatistic);
    if ( statistic == null )
    {
      statistic = new LongNumericStatistic(aStatistic);
      aMonitor.addStatistic(aComponentName, statistic);
    }

    if (statistic instanceof LongNumericStatistic)
    {
View Full Code Here

    }
    return false;
  }
  protected synchronized boolean exceedsThresholdWithinWindow(Monitor aMonitor, String aStat, String aComponent, Threshold aThreshold)
  {
    LongNumericStatistic currentErrorCountStat = aMonitor.getLongNumericStatistic(aComponent, aStat);
    LongNumericStatistic currentProcessCountStat = aMonitor.getLongNumericStatistic(aComponent, Monitor.ProcessCount);
    long numberOfErrors = currentErrorCountStat.getValue();
    // Check if threshold exceeded
    if (numberOfErrors > 0 && aThreshold.getThreshold() > 0 && numberOfErrors % aThreshold.getThreshold() == 0)
    {
      return true;
    }
    // Check if reached end of window. If so, begin counting against a new window
    if (aThreshold.getThreshold() > 0 && aThreshold.getWindow() > 0 && currentProcessCountStat.getValue() % aThreshold.getWindow() == 0)
    {
      aMonitor.resetCountingStatistic(aComponent, aStat);
    }
    return false;
  }
View Full Code Here

        //  Increment number of CASes processed by this service
        getServicePerformance().incrementNumberOfCASesProcessed();
        getServicePerformance().incrementAnalysisTime(timeToProcessCAS);
      }

      LongNumericStatistic statistic = null;
      if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.TotalAEProcessTime)) != null )
      {
        //  Increment how long it took to process the input CAS. This timer is exposed via JMX
        statistic.increment(totalProcessTime);
      }
/*     
      if (newCasReferenceId != null)
      {
        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, getClass().getName(), "process", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_completed_analysis__FINEST", new Object[] { Thread.currentThread().getName(), getComponentName(), newCasReferenceId, (double) (System.nanoTime() - time) / (double) 1000000 });
View Full Code Here

  private void initializeServiceStats()
  {
    Statistic statistic = null;
    if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.TotalDeserializeTime)) == null )
    {
      statistic = new LongNumericStatistic(Monitor.TotalDeserializeTime);
      getMonitor().addStatistic("", statistic);
    }
    if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.TotalSerializeTime)) == null )
    {
      statistic = new LongNumericStatistic(Monitor.TotalSerializeTime);
      getMonitor().addStatistic("", statistic);
    }
    if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.IdleTime)) == null )
    {
      statistic = new LongNumericStatistic(Monitor.IdleTime);
      getMonitor().addStatistic("", statistic);
    }
    if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.ProcessCount)) == null )
    {
      statistic = new LongNumericStatistic(Monitor.ProcessCount);
      getMonitor().addStatistic("", statistic);
    }
    if ( this instanceof PrimitiveAnalysisEngineController )
    {
//      if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.ProcessCount)) == null )
//      {
//        statistic = new LongNumericStatistic(Monitor.ProcessCount);
//        getMonitor().addStatistic("", statistic);
//      }
      if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.ProcessErrorCount)) == null )
      {
        statistic = new LongNumericStatistic(Monitor.ProcessErrorCount);
        getMonitor().addStatistic("", statistic);
      }
      if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.TotalProcessErrorCount)) == null )
      {
        statistic = new LongNumericStatistic(Monitor.TotalProcessErrorCount);
        getMonitor().addStatistic("", statistic);
      }
      if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.TotalAEProcessTime)) == null )
      {
        statistic = new LongNumericStatistic(Monitor.TotalAEProcessTime);
        getMonitor().addStatistic("", statistic);
      }
    }
  }
View Full Code Here

 
  public synchronized void saveIdleTime( long snapshot, String aKey, boolean accumulate )
  {
    if ( accumulate )
    {
      LongNumericStatistic statistic;
      //  Accumulate idle time across all processing threads
      if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.IdleTime)) != null )
      {
        statistic.increment(snapshot);
      }
    }
    getServicePerformance().incrementIdleTime(snapshot);
    idleTime += snapshot;
  }
View Full Code Here

   * Clears controller statistics.
   *
   */
  protected void clearStats()
  {
    LongNumericStatistic statistic;
    Statistics stats = getMonitor().getStatistics("");
    Set set = stats.entrySet();
    for( Iterator it = set.iterator(); it.hasNext();)
    {
      Map.Entry entry = (Map.Entry)it.next();
View Full Code Here

   * Returns a copy of the controller statistics.
   *
   */
  public Map getStats()
  {
    LongNumericStatistic statistic;
    float totalIdleTime = 0;
    long numberCASesProcessed = 0;
    float totalDeserializeTime = 0;
    float totalSerializeTime = 0;
    HashMap map = new HashMap();
   
    if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.IdleTime)) != null )
    {
      if (statistic.getValue() > 0 )
      {
        totalIdleTime = (float) statistic.getValue()/ (float)1000000;   // get millis
      }
    }
    map.put(Monitor.IdleTime, totalIdleTime);
   
    if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.ProcessCount)) != null )
    {
      numberCASesProcessed = statistic.getValue();
    }
    map.put(Monitor.ProcessCount, numberCASesProcessed);
   
    if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.TotalDeserializeTime)) != null )
    {
      if (statistic.getValue() > 0 )
      {
        totalDeserializeTime = (float) statistic.getValue()/ (float)1000000;   // get millis
      }
    }
    map.put(Monitor.TotalDeserializeTime, totalDeserializeTime);

    if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.TotalSerializeTime)) != null )
    {
      if (statistic.getValue() > 0 )
      {
        totalSerializeTime = (float) statistic.getValue()/ (float)1000000;   // get millis
      }
    }
    map.put(Monitor.TotalSerializeTime, totalSerializeTime);
    if ( this instanceof PrimitiveAnalysisEngineController )
    {
      float totalAEProcessTime=0;
      if ( (statistic = getMonitor().getLongNumericStatistic("",Monitor.TotalAEProcessTime)) != null )
      {
        if (statistic.getValue() > 0 )
        {
          totalAEProcessTime = (float) statistic.getValue()/ (float)1000000;   // get millis
        }
      }
      map.put(Monitor.TotalAEProcessTime, totalAEProcessTime);
    }
    return map;
View Full Code Here

  }

  private void initializeServiceStats() {
    Statistic statistic = null;
    if ((statistic = getMonitor().getLongNumericStatistic("", Monitor.TotalDeserializeTime)) == null) {
      statistic = new LongNumericStatistic(Monitor.TotalDeserializeTime);
      getMonitor().addStatistic("", statistic);
    }
    if ((statistic = getMonitor().getLongNumericStatistic("", Monitor.TotalSerializeTime)) == null) {
      statistic = new LongNumericStatistic(Monitor.TotalSerializeTime);
      getMonitor().addStatistic("", statistic);
    }
    if ((statistic = getMonitor().getLongNumericStatistic("", Monitor.IdleTime)) == null) {
      statistic = new LongNumericStatistic(Monitor.IdleTime);
      getMonitor().addStatistic("", statistic);
    }
    if ((statistic = getMonitor().getLongNumericStatistic("", Monitor.ProcessCount)) == null) {
      statistic = new LongNumericStatistic(Monitor.ProcessCount);
      getMonitor().addStatistic("", statistic);
    }
    if (this instanceof PrimitiveAnalysisEngineController) {
      if ((statistic = getMonitor().getLongNumericStatistic("", Monitor.ProcessErrorCount)) == null) {
        statistic = new LongNumericStatistic(Monitor.ProcessErrorCount);
        getMonitor().addStatistic("", statistic);
      }
      if ((statistic = getMonitor().getLongNumericStatistic("", Monitor.TotalProcessErrorCount)) == null) {
        statistic = new LongNumericStatistic(Monitor.TotalProcessErrorCount);
        getMonitor().addStatistic("", statistic);
      }
      if ((statistic = getMonitor().getLongNumericStatistic("", Monitor.TotalAEProcessTime)) == null) {
        statistic = new LongNumericStatistic(Monitor.TotalAEProcessTime);
        getMonitor().addStatistic("", statistic);
      }
    }
  }
View Full Code Here

  /**
   * Clears controller statistics.
   *
   */
  protected void clearStats() {
    LongNumericStatistic statistic;
    Statistics stats = getMonitor().getStatistics("");
    Set set = stats.entrySet();
    for (Iterator it = set.iterator(); it.hasNext();) {
      Map.Entry entry = (Map.Entry) it.next();
      if (entry != null && entry.getValue() != null
View Full Code Here

TOP

Related Classes of org.apache.uima.aae.monitor.statistics.LongNumericStatistic

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.