コード例 #1
0
        public GetTopMethodLoadResponse TopNMethods(GetTopMethodLoadRequest request)
        {
            var response = new GetTopMethodLoadResponse();

            response.MethodLoadDetailList = new List <MethodLoadDetails>();

            var list = _hbArchiveItems.Where(x => x.ClientMachine == request.ServerName);

            foreach (var hbArchieveItem in list)
            {
                response.MethodLoadDetailList.Add(new MethodLoadDetails()
                {
                    MethodName      = hbArchieveItem.MethodName,
                    ApplicationName = hbArchieveItem.ApplicationName,
                    ServerName      = hbArchieveItem.ClientMachine,
                    Load            = hbArchieveItem.AverageDuration * hbArchieveItem.ExecutionCount,
                    ExceptionCount  = hbArchieveItem.ExceptionCount,
                    AverageDuration = hbArchieveItem.AverageDuration,
                    ExecutionCount  = hbArchieveItem.ExecutionCount
                });
            }

            response.MethodLoadDetailList = response.MethodLoadDetailList.OrderByDescending(or => or.Load).Take(request.MethodNumber).ToList();
            return(response);
        }
コード例 #2
0
 public GetTopMethodLoadResponse GetTopMethods(GetTopMethodLoadRequest request)
 {
     return(_hbArchiveProcessor.TopNMethods(request));
 }