private void createPortStatMetric(List<String> metricSequence,StoragePort port,Map<String,Object> keyMap,List<Stat> portStatsList,String metrics[]){
  int count=0;
  Stat portStat=new Stat();
  Long kbytes=0L;
  Long iops=0L;
  String statisticTime="";
  for (  String metricName : metricSequence) {
    portStat.setTimeCollected((Long)keyMap.get(Constants._TimeCollected));
    portStat.setTimeInMillis((Long)keyMap.get(Constants._TimeCollected));
    portStat.setNativeGuid(port.getNativeGuid());
    portStat.setResourceId(port.getId());
    portStat.setServiceType(Constants._Block);
switch (FEPortMetric.lookup(metricName)) {
case InstanceID:
case ElementType:
      break;
case TotalIOs:
    iops=ControllerUtils.getLongValue(metrics[count]);
  portStat.setTotalIOs(iops);
break;
case KBytesTransferred:
kbytes=ControllerUtils.getLongValue(metrics[count]);
portStat.setKbytesTransferred(kbytes);
break;
case StatisticTime:
statisticTime=metrics[count];
break;
default :
_logger.warn("Ignoring unknown metric {} during system metric processing:",metricName);
break;
}
count++;
}
portStatsList.add(portStat);
portMetricsProcessor.processFEPortMetrics(kbytes,iops,port,convertCIMStatisticTime(statisticTime));
}

private void createPortStatMetric ( List < String > metricSequence , StoragePort port , Map < String , Object > keyMap , List < Stat > portStatsList , String metrics [ ] ) { int count = 0 ; Stat portStat = new Stat ( ) ; Long kbytes = 0L ; Long iops = 0L ; String statisticTime = "" ; for ( String metricName : metricSequence ) { portStat . setTimeCollected ( ( Long ) keyMap . get ( Constants . _TimeCollected ) ) ; portStat . setTimeInMillis ( ( Long ) keyMap . get ( Constants . _TimeCollected ) ) ; portStat . setNativeGuid ( port . getNativeGuid ( ) ) ; portStat . setResourceId ( port . getId ( ) ) ; portStat . setServiceType ( Constants . _Block ) ; switch ( FEPortMetric . lookup ( metricName ) ) { case InstanceID : case ElementType : break ; case TotalIOs : iops = ControllerUtils . getLongValue ( metrics [ count ] ) ; portStat . setTotalIOs ( iops ) ; break ; case KBytesTransferred : kbytes = ControllerUtils . getLongValue ( metrics [ count ] ) ; portStat . setKbytesTransferred ( kbytes ) ; break ; case StatisticTime : statisticTime = metrics [ count ] ; break ; default : _logger . warn ( "Ignoring unknown metric {} during system metric processing:" , metricName ) ; break ; } count ++ ; } portStatsList . add ( portStat ) ; portMetricsProcessor . processFEPortMetrics ( kbytes , iops , port , convertCIMStatisticTime ( statisticTime ) ) ; }
create a new portstat .
