Skip to content

Commit

Permalink
Fix metrics test (#87898)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephen Toub <[email protected]>
  • Loading branch information
tarekgh and stephentoub committed Jun 22, 2023
1 parent b878df7 commit 85a8413
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,9 @@ public void MeterDisposeTest()
Counter<int> counter = meter.CreateCounter<int>("MyCounter");

using MeterListener listener = new MeterListener();
listener.InstrumentPublished = (instrument, theListener) =>
{
if (instrument == counter)
{
listener.EnableMeasurementEvents(counter, counter);
}
};
int lastMeasurement = 0;
listener.SetMeasurementEventCallback<int>((inst, measurement, tags, state) => lastMeasurement = measurement);
listener.Start();
listener.EnableMeasurementEvents(counter, null);

counter.Add(10);
Assert.Equal(10, lastMeasurement);
Expand Down

0 comments on commit 85a8413

Please sign in to comment.