Пример #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);
        }
Пример #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++;
        }
Пример #3
0
 /// <summary>
 /// Try to get the count of samples for the given histogram keys
 /// </summary>
 public bool TryGet(HistogramKeys keys, out int count)
 {
     return(m_Hist.TryGet(keys, out count));
 }
Пример #4
0
 /// <summary>
 /// Return the count of samples for the given histogram keys
 /// </summary>
 public int this[HistogramKeys keys] {
     get { return(m_Hist[keys]); }
 }
Пример #5
0
 /// <summary>
 /// Return the count of samples for the given histogram keys
 /// </summary>
 public int this[HistogramKeys keys] {
     get { return(m_Data[keys].Count); }
 }
Пример #6
0
 public HistogramEntry(HistogramKeys keys)
 {
     m_BucketKeys = keys;
     m_Count      = 1;
 }