public AggregationOperationResult Do(IList<UniversalValue> input)
 {
     if (input == null)
         throw new ArgumentNullException("input");
     AggregationOperationResult result = new AggregationOperationResult();
     result.Add("min", input.Min());
     return result;
 }
        public AggregationOperationResult Do(IList <UniversalValue> input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            UniversalValue first      = input.FirstOrDefault();
            double         totalCount = input.Count();

            if (first == null)
            {
                throw new Exception("Sequence contains no elements");
            }
            if (first.Type != _valuesDataType)
            {
                throw new Exception("Input type not equals to group type");
            }

            AggregationOperationResult result = new AggregationOperationResult();

            _distributionGroups.ForEach(
                dg =>
                result.Add(dg.AsHumanReadable,
                           new UniversalValue((input.Count(i => i >= dg.LowerBound && i < dg.UpperBound) / totalCount) * 100)));

            return(result);
        }
 public AggregationOperationResult Do(IList<UniversalValue> input)
 {
     Thread.Sleep(2000);
     if (input == null)
         throw new ArgumentNullException("input");
     AggregationOperationResult result = new AggregationOperationResult();
     result.Add("count", new UniversalValue(input.Count));
     
     return result;
 }
Exemple #4
0
        public AggregationOperationResult Do(IList <UniversalValue> input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            AggregationOperationResult result = new AggregationOperationResult();

            result.Add("avg", input.Average());
            return(result);
        }
 public AggregationOperationResult Do(IList<UniversalValue> input)
 {
     if (input == null)
         throw new ArgumentNullException("input");
     UniversalValue first = input.FirstOrDefault();
     if (first == null)
         throw new Exception("Sequence contains no elements");
     AggregationOperationResult result = new AggregationOperationResult();
     IOrderedEnumerable<UniversalValue> sortedData = input.OrderBy(i => i);
     _percents.ForEach(pp => result.Add(pp.ToString(CultureInfo.InvariantCulture), new UniversalValue(Percentile(sortedData, pp))));
     return result;
 }
Exemple #6
0
        public AggregationOperationResult Do(IList <UniversalValue> input)
        {
            Thread.Sleep(2000);
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            AggregationOperationResult result = new AggregationOperationResult();

            result.Add("count", new UniversalValue(input.Count));

            return(result);
        }
        public AggregationOperationResult Do(IList <UniversalValue> input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            UniversalValue first = input.FirstOrDefault();

            if (first == null)
            {
                throw new Exception("Sequence contains no elements");
            }
            AggregationOperationResult          result     = new AggregationOperationResult();
            IOrderedEnumerable <UniversalValue> sortedData = input.OrderBy(i => i);

            _percents.ForEach(pp => result.Add(pp.ToString(CultureInfo.InvariantCulture), new UniversalValue(Percentile(sortedData, pp))));
            return(result);
        }
        public AggregationOperationResult Do(IList<UniversalValue> input)
        {
            if (input == null)
                throw new ArgumentNullException("input");
            UniversalValue first = input.FirstOrDefault();
            double totalCount = input.Count();
            if (first == null)
                throw new Exception("Sequence contains no elements");
            if (first.Type != _valuesDataType)
                throw new Exception("Input type not equals to group type");
            
            AggregationOperationResult result = new AggregationOperationResult();

            _distributionGroups.ForEach(
                dg =>
                result.Add(dg.AsHumanReadable,
                           new UniversalValue((input.Count(i => i >= dg.LowerBound && i < dg.UpperBound)/totalCount)*100)));

            return result;
        }