public void LoadStatus(Url[] urls, Url url) { if (!mInLoadStatus) { mInLoadStatus = true; try { if (httpClusterApi == null) { httpClusterApi = new BeetleX.FastHttpApi.Clients.HttpClusterApi(); httpClusterApi.AddHost("*", Name); serverStatus = httpClusterApi.Create <IServerStatus>(); } var result = serverStatus.Get(); result.Name = this.Name; Cpu = result.Cpu; Memory = result.Memory / 1024; long total = 0, per = 0; if (url.Name == "*") { foreach (var item in result.Actions) { bool match = false; foreach (var u in urls) { if (u == url) { continue; } if (Regex.IsMatch(item.Url, u.Name, RegexOptions.IgnoreCase)) { match = true; break; } } if (!match) { total += item.Requests; per += item.RequestsPer; } } } else { foreach (var item in result.Actions) { if (Regex.IsMatch(item.Url, url.Name, RegexOptions.IgnoreCase)) { total += item.Requests; per += item.RequestsPer; } } } TotalRequest = total; RequestPer = per; Status = result; } catch (Exception e_) { LoadStatusError = e_; } finally { mInLoadStatus = false; } } }