Пример #1
0
        // GET: GridReading
        public ActionResult ServiceNameBinding([DataSourceRequest] DataSourceRequest request, ServerName server)
        {
            var client = PortalClients.HeartBeatServerClient;

            var list = new List<ServiceName>();

            var serviceResponse = client.GetServices(new GetServicesRequest()
            {
                ServerName = server.Name
            });

            foreach (var service in serviceResponse.ServiceInfoList)
            {
                list.Add(new ServiceName {Name = service.ApplicationNamek__BackingField});
            }

            return Json(list.ToDataSourceResult(request));
        }
Пример #2
0
        public ActionResult TopMethodBinding([DataSourceRequest] DataSourceRequest request, ServerName server)
        {
            var client = PortalClients.HeartBeatServerClient;

            var topMethods = new List<TopMethodLoads>();

            var topMethodResponse = client.GetTopMethods(new GetTopMethodLoadRequest()
            {
                ServerName = server.Name,
                MethodNumber = 50
            });

            foreach (var method in topMethodResponse.MethodLoadDetailList)
            {
                topMethods.Add(new TopMethodLoads {ApplicationName = method.ApplicationName, MethodName = method.MethodName, Load = method.Load, ExceptionCount = method.ExceptionCount, ExecutionCount = method.ExecutionCount, AverageDuration = method.AverageDuration});
            }

            return Json(topMethods.ToDataSourceResult(request));
        }