Exemplo n.º 1
0
 public IEnumerable <AppMetric> CollectMetrics()
 {
     return(AppMetricsCollection.JoinCollectMetrics(mTaskBuffer,
                                                    mTaskPoller,
                                                    mTaskQueueConsumer,
                                                    mTaskResultQueue,
                                                    mExecutionPerfMon,
                                                    AppMetricsCollection.JoinProviders(mWorkers)));
 }
Exemplo n.º 2
0
 public AppMetric QueryMetric(AppMetricId metricId)
 {
     return(AppMetricsCollection.JoinQueryMetric(metricId,
                                                 mTaskBuffer,
                                                 mTaskPoller,
                                                 mTaskQueueConsumer,
                                                 mTaskResultQueue,
                                                 mExecutionPerfMon,
                                                 AppMetricsCollection.JoinProviders(mWorkers)));
 }
        public void Test_JoinMetricsFromProviders_NoOverlappingMetricIds_DefaultInitialValues(int nCollections)
        {
            List <AppMetricId>[] metricIdsBatches =
                GetAppMetricIdsBatches(nCollections);

            List <AppMetricId> expectedMetricIds =
                GetUniqueMetricIds(metricIdsBatches);

            AppMetricsCollection[] collections =
                GetCollectionsFromMetricIdsBatchesWithInitialValues(metricIdsBatches);

            AppMetricsCollection finalCollection = AppMetricsCollection
                                                   .JoinProviders(collections);

            Assert_AppMetricsCollection_CorrectlyInitialized(expectedMetricIds,
                                                             finalCollection);
        }
        public void Test_JoinMetricsFromProviders_SameMetricIds_CustomInitialValues(int nCollections)
        {
            AppMetricId[] allMetricIds = AllBuiltInMetricIds;

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

            AppMetricsCollection[] collections =
                GetCollectionsFromMetricIdsBatchesWithCustomValues(metricIdsBatches);

            List <AppMetric> expectedMetrics =
                MergeAppMetrics(collections);

            AppMetricsCollection finalCollection = AppMetricsCollection
                                                   .JoinProviders(collections);

            Assert_AppMetricsCollection_CorrectlyInitialized(expectedMetrics,
                                                             finalCollection);
        }
        public void Test_JoinMetricsFromProviders_WithOverlappingMetricIds_CustomInitialValues(int nCollections)
        {
            List <AppMetricId>[] metricIdsBatches =
                GetAppMetricIdsBatches(nCollections);

            metricIdsBatches = InterleaveAppMetricIdsBatches(metricIdsBatches);

            AppMetricsCollection[] collections =
                GetCollectionsFromMetricIdsBatchesWithCustomValues(metricIdsBatches);

            List <AppMetric> expectedMetrics =
                MergeAppMetrics(collections);

            AppMetricsCollection finalCollection = AppMetricsCollection
                                                   .JoinProviders(collections);

            Assert_AppMetricsCollection_CorrectlyInitialized(expectedMetrics,
                                                             finalCollection);
        }