Exemple #1
0
        protected internal string GetStatistic(IAggregation agg, IMeasure measure)
        {
            var result = agg.Match <string>(
                (arg) =>
            {
                return("total");
            },
                (arg) =>
            {
                return("count");
            },
                (arg) =>
            {
                return("total");
            },
                (arg) =>
            {
                return("total");
            },
                (arg) =>
            {
                return("value");
            },
                (arg) =>
            {
                return("unknown");
            });

            if (MeasureUnit.IsTimeUnit(measure.Unit) && result == "total")
            {
                result = "totalTime";
            }

            return(result);
        }
Exemple #2
0
        protected internal MetricStatistic GetStatistic(IAggregation agg, IMeasure measure)
        {
            var result = agg.Match <MetricStatistic>(
                (arg) =>
            {
                return(MetricStatistic.TOTAL);
            },
                (arg) =>
            {
                return(MetricStatistic.COUNT);
            },
                (arg) =>
            {
                return(MetricStatistic.TOTAL);
            },
                (arg) =>
            {
                return(MetricStatistic.TOTAL);
            },
                (arg) =>
            {
                return(MetricStatistic.VALUE);
            },
                (arg) =>
            {
                return(MetricStatistic.UNKNOWN);
            });

            if (MeasureUnit.IsTimeUnit(measure.Unit) && result == MetricStatistic.TOTAL)
            {
                result = MetricStatistic.TOTALTIME;
            }

            return(result);
        }