示例#1
0
 public AppMetric QueryMetric(AppMetricId metricId)
 {
     return(AppMetricsCollection.JoinQueryMetric(metricId,
                                                 mTaskBuffer,
                                                 mTaskPoller,
                                                 mTaskQueueConsumer,
                                                 mTaskResultQueue,
                                                 mExecutionPerfMon,
                                                 AppMetricsCollection.JoinProviders(mWorkers)));
 }
        private void Assert_CorrectJoinQueryAppMetrics(IEnumerable <AppMetricId> checkMetricIds,
                                                       AppMetricsCollection[] collectionBatches)
        {
            foreach (AppMetricId metricId in checkMetricIds)
            {
                long expectedValue = SumMetricValues(collectionBatches,
                                                     metricId);

                AppMetric metric = AppMetricsCollection.JoinQueryMetric(metricId,
                                                                        collectionBatches);

                Assert.NotNull(metric);
                Assert.AreEqual(expectedValue, metric.Value);
            }
        }
        public void Test_CanJoinQueryMetric_AbsentFromAllProviders(int nCollections)
        {
            AppMetricId[] allMetricIds = AllBuiltInMetricIds;

            foreach (AppMetricId testMetricId in allMetricIds)
            {
                AppMetricId[] metricIds = AllBuiltInMetricIds
                                          .Where(m => !m.Equals(testMetricId))
                                          .ToArray();

                List <AppMetricId>[] metricIdsBatches = metricIds
                                                        .MultiplyCollection(nCollections);

                AppMetricsCollection[] collections =
                    GetCollectionsFromMetricIdsBatchesWithCustomValues(metricIdsBatches);

                AppMetric testMetric = AppMetricsCollection.JoinQueryMetric(testMetricId,
                                                                            collections);

                Assert.IsNull(testMetric);
            }
        }
 public AppMetric QueryMetric(AppMetricId metricId)
 {
     return(AppMetricsCollection.JoinQueryMetric(metricId,
                                                 mMetrics,
                                                 mNotificationListener));
 }