Exemple #1
0
        /// <summary>
        /// Create a counter based on an entry
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        private IStatsCounter NameToCounter(int id, string name)
        {
            IStatsCounter rv = null;

            // check if the name has a type encoded
            if (name.Length > 2 && name[1] == ':')
            {
                StatsTableEntry entry = new StatsTableEntry(id, name.Substring(2), table_);
                switch (name[0])
                {
                case 't':
                    rv = new StatsTimer(entry);
                    break;

                case 'c':
                    rv = new StatsCounter(entry);
                    break;
                }
            }
            else
            {
                StatsTableEntry entry = new StatsTableEntry(id, name, table_);
                rv = new StatsCounter(entry);
            }

            return(rv);
        }
 public StatsCounterRate(StatsCounter counter, StatsTimer timer)
 {
     counter_ = counter;
       timer_ = timer;
 }
        /// <summary>
        /// Create a counter based on an entry
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        private IStatsCounter NameToCounter(int id, string name)
        {
            IStatsCounter rv = null;

              // check if the name has a type encoded
              if (name.Length > 2 && name[1] == ':')
              {
            StatsTableEntry entry = new StatsTableEntry(id, name.Substring(2), table_);
            switch (name[0])
            {
              case 't':
            rv = new StatsTimer(entry);
            break;
              case 'c':
            rv = new StatsCounter(entry);
            break;
            }
              }
              else
              {
            StatsTableEntry entry = new StatsTableEntry(id, name, table_);
            rv = new StatsCounter(entry);
              }

              return rv;
        }
Exemple #4
0
 public StatsCounterRate(StatsCounter counter, StatsTimer timer)
 {
     counter_ = counter;
     timer_   = timer;
 }