Ejemplo n.º 1
0
        /// <summary>
        /// Try to get the count of samples for the given histogram keys
        /// </summary>
        public bool TryGet(HistogramKeys keys, out int count)
        {
            HistogramEntry entry  = new HistogramEntry(keys);
            bool           result = m_Data.TryGetValue(keys, out entry);

            count = result ? entry.Count : 0;
            return(result);
        }
Ejemplo n.º 2
0
        internal void DoSample(HistogramKeys keys)
        {
            HistogramEntry entry;

            if (m_Data.TryGetValue(keys, out entry))
            {
                entry.m_Count++;
            }
            else
            {
                m_Data.Add(keys, new HistogramEntry(keys));
            }

            m_TotalSamples++;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Return the count of samples for the given histogram keys
 /// </summary>
 public int this[HistogramKeys keys] {
     get { return(m_Data[keys].Count); }
 }
Ejemplo n.º 4
0
 public HistogramEntry(HistogramKeys keys)
 {
     m_BucketKeys = keys;
     m_Count      = 1;
 }