Exemplo n.º 1
0
        internal static async Task<List<LineChartSeries>> BuildChartData(IDiagnosticsModuleStore context, DateTime from, DateTime to, Func<DiagnosticsEntry, string> propertyFilter,
                Func<DiagnosticsEntry, string> nameFunction)
        {
            var results = new List<LineChartSeries>();

            var data = await context.FilterAsync(from, to, null, null, null, null, null, null, null, null, null, null, null, null);

            var groupedSeries = data.GroupBy(propertyFilter).ToList();

            foreach (var seriesData in groupedSeries)
            {
                var series = new LineChartSeries(nameFunction(seriesData.First()));

                foreach (var date in ChartingUtilities.BuildLineChartAxis(from, to))
                {
                    series.Data.Add(date);
                }

                var groupedData = seriesData.GroupBy(x => x.Timestamp.Date).ToList();

                foreach (var itemData in groupedData)
                {
                    var date = itemData.Key;
                    var errors = itemData.Count();

                    var point = series.Data.First(x => x.Date == date);

                    point.Value = errors;
                }

                results.Add(series);
            }

            return results;
        }
            protected override async Task <object> ExecuteAsync(Command request)
            {
                var results = await _context.FilterAsync(request.DateFrom, request.DateTo, request.Versions, request.Areas, request.Layers,
                                                         request.Domains, request.Sources, request.Users, request.Browsers, request.Agents, request.OperatinSystems,
                                                         request.Devices, request.Messages, request.RequestId);

                return(results);
            }
Exemplo n.º 3
0
            protected override async Task <object> ExecuteAsync(Command request)
            {
                var data = await _context.FilterAsync(request.DateFrom, request.DateTo, null, null, null, null, null, null, null, null, null, null, null, null);

                var groupedData = data.GroupBy(x => x.Timestamp.Date).ToList();

                var chartData = ChartingUtilities.BuildLineChartAxis(request.DateFrom, request.DateTo);

                foreach (var itemData in groupedData)
                {
                    var date   = itemData.Key;
                    var errors = itemData.Count();

                    var point = chartData.First(x => x.Date == date);

                    point.Value = errors;
                }

                return(chartData);
            }