Пример #1
0
 public virtual MutableRate NewRate(string name, string desc, bool extended, bool
                                    returnExisting)
 {
     lock (this)
     {
         if (returnExisting)
         {
             MutableMetric rate = metricsMap[name];
             if (rate != null)
             {
                 if (rate is MutableRate)
                 {
                     return((MutableRate)rate);
                 }
                 throw new MetricsException("Unexpected metrics type " + rate.GetType() + " for "
                                            + name);
             }
         }
         CheckMetricName(name);
         MutableRate ret = new MutableRate(name, desc, extended);
         metricsMap[name] = ret;
         return(ret);
     }
 }