/// <summary>
        ///
        /// </summary>
        protected override void Execute()
        {
            string filter      = Tools.GenerateFilter(MetricNames);
            bool   fullDetails = this.DetailedOutput.IsPresent;

            MetricDefinitionsResult definitions = GetMetricDefinitionsResult(filter);
            var result = definitions.Value.Select(_ => fullDetails ? new PSMetricDefinition(_) : new PSMetricDefinitionNoDetails(_));

            WriteObject(result);
        }
        private void CompareMetricDefinition(MetricDefinitionsResult result)
        {
            Assert.True(result.Value.Count > 1);

            Assert.Equal(result.Value[0].Name.Value, "Total Requests");

            Assert.Equal(result.Value[0].Unit, MetricUnit.Count);

            Assert.True(result.Value[0].MetricAvailabilities.Count > 0);

            Assert.Equal(result.Value[0].MetricAvailabilities[0].Retention, TimeSpan.FromDays(1));

            Assert.Equal(result.Value[0].MetricAvailabilities[0].TimeGrain, TimeSpan.FromMinutes(1));

            Assert.Equal(result.Value[0].PrimaryAggregationType, MetricPrimaryAggregationType.Total);
        }
Пример #3
0
        private void CompareMetricDefinition(MetricDefinitionsResult result)
        {
            Assert.True(result.Value.Count > 1);

            Assert.Equal(result.Value[0].Name.Value, "Total Requests");

            Assert.Equal(result.Value[0].Unit, MetricUnit.Count);

            Assert.True(result.Value[0].MetricAvailabilities.Count > 0);

            Assert.Equal(result.Value[0].MetricAvailabilities[0].Retention, TimeSpan.FromDays(1));

            Assert.Equal(result.Value[0].MetricAvailabilities[0].TimeGrain, TimeSpan.FromMinutes(1));

            Assert.Equal(result.Value[0].PrimaryAggregationType, MetricPrimaryAggregationType.Total);
        }