示例#1
0
        protected override async Task ActionAsync(CancellationToken cts)
        {
            var ozzyNode = _serviceProvider.GetService <OzzyNode>();

            var data = new NodeMonitoringInfo()
            {
                NodeId          = ozzyNode.NodeId,
                MachineName     = Environment.MachineName,
                BackgroundTasks = ozzyNode.BackgroundProcesses.Select(p => new BackgroundTaskMonitoringInfo()
                {
                    TaskId    = p.ProcessId,
                    TaskName  = p.ProcessName,
                    TaskState = p.ProcessState,
                    IsRunning = p.IsRunning
                }).ToList(),
                MonitoringTimeStamp = DateTime.Now
            };

            await _monitoringManager.SaveNodeMonitoringInfo(data);
        }
示例#2
0
 public async Task SaveNodeMonitoringInfo(NodeMonitoringInfo data)
 {
     await _monitoringRepository.SaveNodeMonitoringInfo(data);
 }
 public async Task SaveNodeMonitoringInfo(NodeMonitoringInfo data)
 {
     _data[data.NodeId] = data;
 }