public void TestEmptyPerPipPerformanceInformation()
        {
            var resp = m_perPipPerformanceInformationStore.GenerateTopPipPerformanceInfoJsonArray();

            Assert.Equal(0, resp.Length);
            var perfArr = AssertMessageSizesAndParseJsonArray(resp);

            Assert.Equal(0, perfArr.Length);
        }
        public void TestZeroCapacityPerPipPerformanceInformation()
        {
            var perPipPerformanceInformationStore = new PerProcessPipPerformanceInformationStore(0, m_configuration.Logging.AriaIndividualMessageSizeLimitBytes);

            perPipPerformanceInformationStore.AddPip(CreateSamplePip(1));
            var resp = m_perPipPerformanceInformationStore.GenerateTopPipPerformanceInfoJsonArray();

            Assert.Equal(0, resp.Length);
            var perfArr = AssertMessageSizesAndParseJsonArray(resp);

            Assert.Equal(0, perfArr.Length);
        }
        public void TestMultipleBatchOfPipPerformanceInformation()
        {
            m_configuration.Logging.MaxNumPipTelemetryBatches = 4;
            m_perPipPerformanceInformationStore = new PerProcessPipPerformanceInformationStore(m_configuration.Logging.MaxNumPipTelemetryBatches, m_configuration.Logging.AriaIndividualMessageSizeLimitBytes);
            AddMultiplePips(200000);
            var resp = m_perPipPerformanceInformationStore.GenerateTopPipPerformanceInfoJsonArray();

            Assert.Equal(4, resp.Length);
            VerifyMultiplePips(AssertMessageSizesAndParseJsonArray(resp));
        }
        public void TestLargeDescPipBetweenRegularPipPerformanceInformation()
        {
            m_configuration.Logging.AriaIndividualMessageSizeLimitBytes = s_individualPipInfoStringLength * 2;
            m_configuration.Logging.MaxNumPipTelemetryBatches           = 10;
            m_perPipPerformanceInformationStore = new PerProcessPipPerformanceInformationStore(m_configuration.Logging.MaxNumPipTelemetryBatches, m_configuration.Logging.AriaIndividualMessageSizeLimitBytes);
            AddMultiplePips(1);
            m_perPipPerformanceInformationStore.AddPip(new PerProcessPipPerformanceInformation($"Pip LARGE Desc: {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix}", 8000, 8000, 8000, 8000));
            AddMultiplePips(10, 2);
            m_perPipPerformanceInformationStore.AddPip(new PerProcessPipPerformanceInformation($"Pip LARGE Desc: {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix}", 9000, 9000, 9000, 9000));
            AddMultiplePips(20, 11);
            m_perPipPerformanceInformationStore.AddPip(new PerProcessPipPerformanceInformation($"Pip LARGE Desc: {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix} {LargeDesciptionsSuffix}", 7000, 7000, 7000, 7000));
            var resp = m_perPipPerformanceInformationStore.GenerateTopPipPerformanceInfoJsonArray();

            Assert.Equal(10, resp.Length);
            VerifyMultiplePips(AssertMessageSizesAndParseJsonArray(resp), 20);
        }