public async Task GetDataFeedIngestionStatusesAsync()
        {
            string endpoint        = MetricsAdvisorUri;
            string subscriptionKey = MetricsAdvisorSubscriptionKey;
            string apiKey          = MetricsAdvisorApiKey;
            var    credential      = new MetricsAdvisorKeyCredential(subscriptionKey, apiKey);

            var adminClient = new MetricsAdvisorAdministrationClient(new Uri(endpoint), credential);

            #region Snippet:GetDataFeedIngestionStatusesAsync
#if SNIPPET
            string dataFeedId = "<dataFeedId>";
#else
            string dataFeedId = DataFeedId;
#endif

            var startTime = DateTimeOffset.Parse("2020-01-01T00:00:00Z");
            var endTime   = DateTimeOffset.Parse("2020-09-09T00:00:00Z");
            var options   = new GetDataFeedIngestionStatusesOptions(startTime, endTime)
            {
                MaxPageSize = 5
            };

            Console.WriteLine("Ingestion statuses:");
            Console.WriteLine();

            int statusCount = 0;

            await foreach (DataFeedIngestionStatus ingestionStatus in adminClient.GetDataFeedIngestionStatusesAsync(dataFeedId, options))
            {
                Console.WriteLine($"Timestamp: {ingestionStatus.Timestamp}");
                Console.WriteLine($"Status: {ingestionStatus.Status}");
                Console.WriteLine($"Service message: {ingestionStatus.Message}");
                Console.WriteLine();

                // Print at most 5 statuses.
                if (++statusCount >= 5)
                {
                    break;
                }
            }
            #endregion
        }
        public async Task GetDataFeedIngestionStatuses(bool useTokenCredential)
        {
            MetricsAdvisorAdministrationClient adminClient = GetMetricsAdvisorAdministrationClient(useTokenCredential);

            var options = new GetDataFeedIngestionStatusesOptions(SamplingStartTime, SamplingEndTime);

            var statusCount = 0;

            await foreach (DataFeedIngestionStatus status in adminClient.GetDataFeedIngestionStatusesAsync(DataFeedId, options))
            {
                Assert.That(status, Is.Not.Null);
                Assert.That(status.Timestamp, Is.InRange(SamplingStartTime, SamplingEndTime));
                Assert.That(status.Status, Is.Not.EqualTo(default(IngestionStatusType)));
                Assert.That(status.Message, Is.Not.Null);

                if (++statusCount >= MaximumSamplesCount)
                {
                    break;
                }
            }

            Assert.That(statusCount, Is.GreaterThan(0));
        }