예제 #1
0
        public async Task <IEnumerable <LogSummaryByLevel> > GetSummaryByLevel()
        {
            var groupedEntries = (await _logServices.GetEntries())
                                 .GroupBy(x => x.EventLevel);

            return((groupedEntries.Select(group =>
                                          new LogSummaryByLevel
            {
                EventLevel = group.Key.ToString(),
                Count = group.Count()
            })).OrderByDescending(x => x.Count));
        }
예제 #2
0
        public async Task <IEnumerable <LogSummary> > GetSummary()
        {
            var groupedEntries = (await _logServices.GetEntries())
                                 .GroupBy(x => x.ShortMessage);

            return((groupedEntries.Select(group =>
                                          new LogSummary
            {
                ShortMessage = group.Key,
                Count = group.Count()
            })).OrderByDescending(x => x.Count));
        }
예제 #3
0
파일: TopController.cs 프로젝트: forki/Labs
        public async Task <IEnumerable <LogEntry> > GetTopItems(int count, string level)
        {
            switch (level)
            {
            case "items":
                return((await _logServices.GetEntries())
                       .OrderByDescending(x => x.TimeStamp)
                       .Take(count));

            default:
                return((await _logServices.GetEntries())
                       .Where(x => x.EventLevel == (eEventLevel)Enum.Parse(typeof(eEventLevel), level))
                       .OrderByDescending(x => x.TimeStamp)
                       .Take(count));
            }
        }
예제 #4
0
 public async Task <IEnumerable <LogEntry> > GetItems()
 {
     return(await _logServices.GetEntries());
 }