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)); }
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)); }
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)); } }
public async Task <IEnumerable <LogEntry> > GetItems() { return(await _logServices.GetEntries()); }