Example #1
0
        /// <summary>Adds the counter to the set that the EventSource will report on.</summary>
        /// <remarks>
        /// Must only be invoked once, and only after the instance has been fully initialized.
        /// This should be invoked by a derived type's ctor as the last thing it does.
        /// </remarks>
        private protected void Publish()
        {
            Debug.Assert(_group is null);
            Debug.Assert(Name != null);
            Debug.Assert(EventSource != null);

            _group = CounterGroup.GetCounterGroup(EventSource);
            _group.Add(this);
        }