示例#1
0
 public IActionResult GetProcessInfo()
 {
     return(ExecuteAndMapToActionResultSync(() =>
     {
         var result = _processInfo
                      .GetProcessInfo()
                      .OrderByDescending(proc => proc.MemoryMbUsed)
                      .ToList();
         return result;
     }));
 }
示例#2
0
        public async Task Notify()
        {
            var info = new WallboardInfo
            {
                CatUrl         = await _cats.GetRandomCatUrl(),
                RandomImageUri = await _images.GetRandomImageSource(),
                ServerStatus   = _memory.GetMemoryInfo().ToList(),
                Processes      = _processes.GetProcessInfo().OrderByDescending(proc => proc.MemoryMbUsed).ToList()
            };

            await _hub.Clients.All.Broadcast(info);
        }