public void processFEAdaptMetrics(Long idleTicks,Long cumTicks,Long iops,StorageHADomain haDomain,String statisticTime){
  StorageSystem system=_dbClient.queryObject(StorageSystem.class,haDomain.getStorageDeviceURI());
  StringMap dbMetrics=haDomain.getMetrics();
  Long sampleTime=convertCIMStatisticTime(statisticTime);
  _log.info(String.format("FEAdaptMetrics %s %s idleTicks %d cumTicks %d iops %d sampleTime %d",haDomain.getAdapterName(),haDomain.getNativeGuid(),idleTicks,cumTicks,iops,sampleTime));
  Long idleTicksValue=MetricsKeys.getLong(MetricsKeys.idleTicksValue,dbMetrics);
  Long cumTicksValue=MetricsKeys.getLong(MetricsKeys.cumTicksValue,dbMetrics);
  Long iopsValue=MetricsKeys.getLong(MetricsKeys.iopsValue,dbMetrics);
  Long idleTicksDelta=idleTicks - idleTicksValue;
  if (idleTicksDelta < 0) {
    idleTicksDelta=-idleTicksDelta;
  }
  Long cumTicksDelta=cumTicks - cumTicksValue;
  if (cumTicksDelta < 0) {
    cumTicksDelta=-cumTicksDelta;
  }
  Long iopsDelta=iops - iopsValue;
  Long busyTicks=cumTicksDelta - idleTicksDelta;
  if (busyTicks >= 0 && cumTicksValue > 0L && cumTicksDelta > 0L) {
    computePercentBusyAverages(busyTicks,cumTicksDelta,iopsDelta,dbMetrics,haDomain.getNativeGuid(),haDomain.getAdapterName() + " [cpu]",sampleTime,system);
  }
  MetricsKeys.putLong(MetricsKeys.idleTicksValue,idleTicks,dbMetrics);
  MetricsKeys.putLong(MetricsKeys.cumTicksValue,cumTicks,dbMetrics);
  MetricsKeys.putLong(MetricsKeys.iopsValue,iops,dbMetrics);
  MetricsKeys.putLong(MetricsKeys.lastSampleTime,sampleTime,dbMetrics);
  haDomain.setMetrics(dbMetrics);
  _dbClient.persistObject(haDomain);
}

public void processFEAdaptMetrics ( Long idleTicks , Long cumTicks , Long iops , StorageHADomain haDomain , String statisticTime ) { StorageSystem system = _dbClient . queryObject ( StorageSystem . class , haDomain . getStorageDeviceURI ( ) ) ; StringMap dbMetrics = haDomain . getMetrics ( ) ; Long sampleTime = convertCIMStatisticTime ( statisticTime ) ; _log . info ( String . format ( "FEAdaptMetrics %s %s idleTicks %d cumTicks %d iops %d sampleTime %d" , haDomain . getAdapterName ( ) , haDomain . getNativeGuid ( ) , idleTicks , cumTicks , iops , sampleTime ) ) ; Long idleTicksValue = MetricsKeys . getLong ( MetricsKeys . idleTicksValue , dbMetrics ) ; Long cumTicksValue = MetricsKeys . getLong ( MetricsKeys . cumTicksValue , dbMetrics ) ; Long iopsValue = MetricsKeys . getLong ( MetricsKeys . iopsValue , dbMetrics ) ; Long idleTicksDelta = idleTicks - idleTicksValue ; if ( idleTicksDelta < 0 ) { idleTicksDelta = - idleTicksDelta ; } Long cumTicksDelta = cumTicks - cumTicksValue ; if ( cumTicksDelta < 0 ) { cumTicksDelta = - cumTicksDelta ; } Long iopsDelta = iops - iopsValue ; Long busyTicks = cumTicksDelta - idleTicksDelta ; if ( busyTicks >= 0 && cumTicksValue > 0L && cumTicksDelta > 0L ) { computePercentBusyAverages ( busyTicks , cumTicksDelta , iopsDelta , dbMetrics , haDomain . getNativeGuid ( ) , haDomain . getAdapterName ( ) + " [cpu]" , sampleTime , system ) ; } MetricsKeys . putLong ( MetricsKeys . idleTicksValue , idleTicks , dbMetrics ) ; MetricsKeys . putLong ( MetricsKeys . cumTicksValue , cumTicks , dbMetrics ) ; MetricsKeys . putLong ( MetricsKeys . iopsValue , iops , dbMetrics ) ; MetricsKeys . putLong ( MetricsKeys . lastSampleTime , sampleTime , dbMetrics ) ; haDomain . setMetrics ( dbMetrics ) ; _dbClient . persistObject ( haDomain ) ; }
process a cpu metric sample . the metrics are compared with the last sample to develop deltas , and those are then used to compute the average metric which is eventually merged into the long term ema average .
