Improve MetricEventSource error handling (#56083)
authorNoah Falk <noahfalk@users.noreply.github.com>
Thu, 22 Jul 2021 07:24:38 +0000 (00:24 -0700)
committerGitHub <noreply@github.com>
Thu, 22 Jul 2021 07:24:38 +0000 (00:24 -0700)
commit14d6532f388903f425f0a3b9dea697c5a28293d3
tree8a5520a05a4b2045b3d28c0796cef94c6628ab6a
parentd82faa5087956920b4c23734d211b7ee5f91f4d4
Improve MetricEventSource error handling (#56083)

Enabling multiple instances of a collection tool was causing
both tools to lose their connections and it wasn't obvious from
within the tool what had happened. I modified the behavior so
that once a tool connects successfully it should never be
disconnected and made a distinctive error event so that
the additional tool instances can easily identify they are trying
an unsupported operation.
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/MetricsEventSource.cs