Пример #1
0
 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);
     }
 }
Пример #2
0
 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());
     }
 }
Пример #8
0
 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());
     }
 }
Пример #9
0
 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());
     }
 }
Пример #10
0
 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());
     }
 }
Пример #12
0
 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());
     }
 }
Пример #13
0
 public List <PerformanceCounterData> GetAllCounterValues(DateTime recordedAfterDateTime)
 {
     using (var context = new MonitoringContext())
     {
         return(context.PerformanceCounterDatas
                .Where(p => p.Timestamp > recordedAfterDateTime)
                .OrderByDescending(o => o.Id)
                .ToList());
     }
 }
Пример #14
0
 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());
     }
 }
Пример #15
0
        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);
        }
Пример #16
0
 public UnitOfWork(MonitoringContext context)
 {
     _context = context;
 }
Пример #17
0
 public CompanyDAL(MonitoringContext dbContext) : base(dbContext)
 {
 }
Пример #18
0
 public HomeController(MonitoringContext context)
 {
     _context = context;
 }
Пример #19
0
 public AgentStateRepository(MonitoringContext context) : base(context)
 {
     _context = context;
 }
 public TerminalRepository(MonitoringContext context) : base(context, context.Terminals)
 {
     _monitoringContext = context;
 }
Пример #21
0
 public VehiclesController(MonitoringContext context)
 {
     _context = context;
 }
Пример #22
0
 public LinkedinProfileDAL(MonitoringContext dbContext) : base(dbContext)
 {
 }
Пример #23
0
 public FormOther(MonitoringContext context)
 {
     this.context = context;
 }
Пример #24
0
 public UsersController(MonitoringContext context)
 {
     _context = context;
 }
Пример #25
0
 public FormGraph(MonitoringContext context)
 {
     this.context = context;
 }
Пример #26
0
 public DbManager()
 {
     monitoringContext = new MonitoringContext();
 }
 public CrossProfileDAL(MonitoringContext dbContext) : base(dbContext)
 {
 }
 public MonitoringDAL(MonitoringContext monitoringContext)
 {
     _monitoringContext = monitoringContext;
 }
Пример #29
0
 public GenericRepository(MonitoringContext context)
 {
     _context = context;
     _dbSet   = context.Set <TEntity>();
 }
 public ServerController(MonitoringContext context)
 {
     _context = context;
 }