Beispiel #1
0
        public TimestampQueryResponse ConvertBDItoTQR(BurnDownInfo data, string target)
        {
            var timestamp = new TimestampQueryResponse()
            {
                Target = target
            };

            var list = new List <long[]>();

            var i = 0;

            for (var dt = data.StartDate; dt <= data.EndDate; dt = dt.AddMinutes(5))
            {
                var unixtime = DateTimeOffset.Parse(dt.ToString()).ToUnixTimeMilliseconds();

                list.Add(new long[] { data.Days[i], unixtime });
                if (dt.Day != dt.AddMinutes(5).Day)
                {
                    i++;
                }
            }

            timestamp.DataPoints = list.ToArray();

            return(timestamp);
        }
        public TimestampQueryResponse GenerageOptimalBurndown(QueryRequest request, string target)
        {
            var total = 100;
            var step  = total / (request.Range.To - request.Range.From).Days;


            var timestamp = new TimestampQueryResponse()
            {
                Target = target
            };

            var list = new List <long[]>();

            for (var dt = request.Range.From; dt <= request.Range.To; dt = dt.AddDays(1))
            {
                var unixtime = dt.ToUnixTimeMilliseconds();
                list.Add(new long[] { total, unixtime });
                total -= step;
            }

            timestamp.DataPoints = list.ToArray();

            return(timestamp);
        }