コード例 #1
0
        /// <summary>Called by MetricsRecordImpl.remove().</summary>
        /// <remarks>
        /// Called by MetricsRecordImpl.remove().  Removes all matching rows in
        /// the internal table of metric data.  A row matches if it has the same
        /// tag names and values as record, but it may also have additional
        /// tags.
        /// </remarks>
        protected internal virtual void Remove(MetricsRecordImpl record)
        {
            string recordName = record.GetRecordName();

            AbstractMetricsContext.TagMap    tagTable  = record.GetTagTable();
            AbstractMetricsContext.RecordMap recordMap = GetRecordMap(recordName);
            lock (recordMap)
            {
                IEnumerator <AbstractMetricsContext.TagMap> it = recordMap.Keys.GetEnumerator();
                while (it.HasNext())
                {
                    AbstractMetricsContext.TagMap rowTags = it.Next();
                    if (rowTags.ContainsAll(tagTable))
                    {
                        it.Remove();
                    }
                }
            }
        }