public override void Setup() { _fixture = new MetricsCoreTestFixture(); _reservoir = new DefaultAlgorithmRReservoir(); _scheduler = new DefaultTaskScheduler(); _scheduler.Interval( TimeSpan.FromMilliseconds(10), TaskCreationOptions.None, () => { _reservoir.GetSnapshot(); _reservoir.Reset(); }); }
private Task Tick() { try { _reservoir.GetSnapshot(); _reservoir.Reset(); } catch (Exception) { } finally { lock (_syncLock) { if (!_disposing) { SetScheduler(); } } } return(Task.CompletedTask); }