示例#1
0
        /// <summary>
        /// Retrieves counter information for given groupname and countername and rolluptype.
        /// </summary>
        /// <param name="groupName"></param>
        /// <param name="counterName"></param>
        /// <param name="rollupType"></param>
        /// <returns>
        /// Returns the object type with the current information of performance counter
        /// </returns>
        private PerfCounterInfo getCounterInfo(String groupName,
                                               String counterName,
                                               PerfSummaryType rollupType)
        {
            ArrayList counters = getCounterInfos(groupName, counterName);

            if (counters != null)
            {
                for (IEnumerator i = counters.GetEnumerator(); i.MoveNext();)
                {
                    PerfCounterInfo pci = (PerfCounterInfo)i.Current;
                    if (rollupType == null || rollupType.Equals(pci.rollupType))
                    {
                        return(pci);
                    }
                }
            }
            return(null);
        }
示例#2
0
 /// <summary>
 /// Retrieves counter information for given groupname and countername and rolluptype.
 /// </summary>
 /// <param name="groupName"></param>
 /// <param name="counterName"></param>
 /// <param name="rollupType"></param>
 /// <returns>
 /// Returns the object type with the current information of performance counter
 /// </returns>
 private PerfCounterInfo getCounterInfo(String groupName, 
                                        String counterName,
                                        PerfSummaryType rollupType) {
    ArrayList counters = getCounterInfos(groupName, counterName);
    if(counters != null) {
       for(IEnumerator i=counters.GetEnumerator(); i.MoveNext();) {
          PerfCounterInfo pci = (PerfCounterInfo)i.Current;
          if(rollupType == null || rollupType.Equals(pci.rollupType)) {
             return pci;
          }
       }
    }
    return null;
 }