Beispiel #1
0
        public void Reservoir_resized_reported_on_post_too_big_response()
        {
            // Arrange
            _customEventAggregator.Collect(new CustomEventWireModel(0.1f, GetCustomEventAttribs()));
            _customEventAggregator.Collect(new CustomEventWireModel(0.2f, GetCustomEventAttribs()));
            Mock.Arrange(() => _dataTransportService.Send(Arg.IsAny <IEnumerable <CustomEventWireModel> >()))
            .Returns <IEnumerable <CustomEventWireModel> >(events =>
            {
                return(DataTransportResponseStatus.ReduceSizeIfPossibleOtherwiseDiscard);
            });

            // Act
            _harvestAction();

            // Assert
            Mock.Assert(() => _agentHealthReporter.ReportCustomEventReservoirResized(1));
        }
Beispiel #2
0
        private void ReduceReservoirSize(int newSize)
        {
            if (newSize >= _customEvents.Size)
            {
                return;
            }

            _customEvents.Resize(newSize);
            _agentHealthReporter.ReportCustomEventReservoirResized(newSize);
        }