///-------------------------------------------------------------------------------------------------
        /// <summary>
        ///  Registers the counter.
        /// </summary>
        /// <param name="name">
        ///  The name.
        /// </param>
        /// <param name="description">
        ///  The description.
        /// </param>
        /// <param name="counterType">
        ///  Type of the counter.
        /// </param>
        /// <returns>
        ///  An IStatisticCounter.
        /// </returns>
        ///-------------------------------------------------------------------------------------------------
        public IStatisticCounter RegisterCounter(string name, string description, StatisticCounterType counterType)
        {
            if (_counters.ContainsKey(name))
            {
                return(_counters[name]);
            }

            var counter = new StatisticCounter(description, counterType);

            _counters.Add(name, counter);
            return(counter);
        }
Пример #2
0
 public IStatisticCounter RegisterCounter(string category, string name, string description, StatisticCounterType counterType)
 {
     return(EmptyCounter.Empty);
 }
Пример #3
0
 ///-------------------------------------------------------------------------------------------------
 /// <summary>
 ///  Constructor.
 /// </summary>
 /// <param name="description">
 ///  The description.
 /// </param>
 /// <param name="counterType">
 ///  (Optional) The total number of er type.
 /// </param>
 ///-------------------------------------------------------------------------------------------------
 public StatisticCounter(string description, StatisticCounterType counterType = StatisticCounterType.Value)
 {
     CounterType = counterType;
     Description = description;
 }
Пример #4
0
        ///-------------------------------------------------------------------------------------------------
        /// <summary>
        ///  Registers the counter.
        /// </summary>
        /// <param name="category">
        ///  The category.
        /// </param>
        /// <param name="name">
        ///  The name.
        /// </param>
        /// <param name="description">
        ///  The description.
        /// </param>
        /// <param name="counterType">
        ///  Type of the counter.
        /// </param>
        /// <returns>
        ///  An IStatisticCounter.
        /// </returns>
        ///-------------------------------------------------------------------------------------------------
        public IStatisticCounter RegisterCounter(string category, string name, string description, StatisticCounterType counterType)
        {
            StatisticCategory cat;

            if (!_categories.TryGetValue(category, out cat))
            {
                cat = new StatisticCategory();
                _categories.Add(category, cat);
            }

            return(cat.RegisterCounter(name, description, counterType));
        }