public List <MaxPerformanceCounterData> GetMaxCounterValues(string counter, DateTime dateTimeAfter) { using (var context = new MonitoringContext()) { var result = (from counters in context.PerformanceCounterDatas where counters.Counter == counter && counters.Timestamp > dateTimeAfter group counters by new { counters.Service, counters.MachineName, counters.Counter } into countersGroup select new { countersGroup.Key.Counter, countersGroup.Key.MachineName, countersGroup.Key.Service, CounterValue = countersGroup.Max(c => c.CounterValue) }) .ToList() .Select(s => new MaxPerformanceCounterData { Counter = s.Counter, MachineName = s.MachineName, Service = s.Service, CounterValue = s.CounterValue }) .ToList(); return(result); } }
public List <PerformanceCounterData> GetPeakCounterValueByService(string service, string counter) { using (var context = new MonitoringContext()) { return(context.PerformanceCounterDatas .Where(p => p.Service.Equals(service) && p.Counter.Equals(counter)) .GroupBy(g => new { g.MachineName, g.Service }, (key, group) => new { key.Service, Timestamp = group.Max(p => p.Timestamp), key.MachineName, Value = group.Max(p => p.CounterValue) }) .ToList() .Select(r => new PerformanceCounterData { Service = r.Service, Timestamp = r.Timestamp, MachineName = r.MachineName, Counter = counter, CounterValue = r.Value }).ToList()); } }
public List <SystemUpTime> GetAllSystemUpTimes() { using (var context = new MonitoringContext()) { return(context.SystemUpTimes .ToList()); } }
public List <SystemDiskSpace> GetAllSystemDiskUsage() { using (var context = new MonitoringContext()) { return(context.SystemDiskSpaces .ToList()); } }
public List <ServiceStatu> GetAllServiceStatus() { using (var context = new MonitoringContext()) { return(context.ServiceStatus .ToList()); } }
public List <AddressBook> GetLastAddressBookUpdate() { using (var context = new MonitoringContext()) { return(context.AddressBooks.OrderByDescending(o => o.Id) .Take(1) .ToList()); } }
public List <SchedulerQueuePending> GetSchedulerQueuePending() { using (var context = new MonitoringContext()) { return(context.SchedulerQueuePendings .OrderBy(o => o.PendingFrom) .ToList()); } }
public List <PerformanceCounterData> GetCounterValues(string instance, string counter, string service, DateTime recordedAfterDateTime) { using (var context = new MonitoringContext()) { return(context.PerformanceCounterDatas .Where(c => counter == c.Counter && c.Service == service && c.InstanceName == instance && c.Timestamp > recordedAfterDateTime) .ToList()); } }
public List <PerformanceCounterData> GetCounterValuesByMachine(string machine, string counter) { using (var context = new MonitoringContext()) { return(context.PerformanceCounterDatas .Where(c => c.Counter == counter && c.MachineName == machine) .ToList()); } }
public List <PerformanceCounterData> GetCounterValues(IEnumerable <string> counter, DateTime recordedAfterDateTime) { using (var context = new MonitoringContext()) { return(context.PerformanceCounterDatas .Where(c => counter.Contains(c.Counter) && c.Timestamp > recordedAfterDateTime) .ToList()); } }
public List <SchedulerQueue> GetLastSchedulerQueueCount() { using (var context = new MonitoringContext()) { return(context.SchedulerQueues .OrderByDescending(o => o.Id) .Take(1) .ToList()); } }
public List <PerformanceCounterData> GetCounterValues(string instance, string counter, string service, decimal minCounterValue) { using (var context = new MonitoringContext()) { return(context.PerformanceCounterDatas .Where(c => counter == c.Counter && c.Service == service && c.InstanceName == instance && c.CounterValue > minCounterValue) .OrderByDescending(o => o.Timestamp) .ToList()); } }
public List <PerformanceCounterData> GetAllCounterValues(DateTime recordedAfterDateTime) { using (var context = new MonitoringContext()) { return(context.PerformanceCounterDatas .Where(p => p.Timestamp > recordedAfterDateTime) .OrderByDescending(o => o.Id) .ToList()); } }
public PerformanceCounterData GetLastCounterValue(string service, string counter) { using (var context = new MonitoringContext()) { return(context.PerformanceCounterDatas .OrderByDescending(o => o.Id) .Where(c => counter == c.Counter && c.Service == service) .Take(1) .First()); } }
public MonPoint getMonPointByID(string project, int id) { var repo = new RepositoryForServer <MonPoint>(project); MonitoringContext monContext = repo.context as MonitoringContext; MonPoint mp = monContext.MonPoint.Where(x => x.ID == id).FirstOrDefault(); if (mp == null) { return(null); } mp.monComponentList = new List <MonComponent>(); List <string> componentNameList = mp.componentNames.Split(',').ToList(); foreach (string key in componentNameList) { mp.monComponentList.Add(new MonComponent() { componentName = key, readings = monContext.MonReading.Where(x => ((x.monPointName == mp.Name) && (x.component == key))).ToList() }); } return(mp); }
public UnitOfWork(MonitoringContext context) { _context = context; }
public CompanyDAL(MonitoringContext dbContext) : base(dbContext) { }
public HomeController(MonitoringContext context) { _context = context; }
public AgentStateRepository(MonitoringContext context) : base(context) { _context = context; }
public TerminalRepository(MonitoringContext context) : base(context, context.Terminals) { _monitoringContext = context; }
public VehiclesController(MonitoringContext context) { _context = context; }
public LinkedinProfileDAL(MonitoringContext dbContext) : base(dbContext) { }
public FormOther(MonitoringContext context) { this.context = context; }
public UsersController(MonitoringContext context) { _context = context; }
public FormGraph(MonitoringContext context) { this.context = context; }
public DbManager() { monitoringContext = new MonitoringContext(); }
public CrossProfileDAL(MonitoringContext dbContext) : base(dbContext) { }
public MonitoringDAL(MonitoringContext monitoringContext) { _monitoringContext = monitoringContext; }
public GenericRepository(MonitoringContext context) { _context = context; _dbSet = context.Set <TEntity>(); }
public ServerController(MonitoringContext context) { _context = context; }