コード例 #1
0
        private static void GetClsuterMetrics(NodePool item)
        {
            string metricurl = MySettings.metricpath.Replace("REPLACEME", item.clusterId);
            var    json      = GetJsonData.GetJson(metricurl, MySettings.token);

            item.Servers = json["items"].ToObject <List <Server> >();
        }
コード例 #2
0
        private static void GetClsuterMetrics(Cluster item)
        {
            //Console.WriteLine("GetClsuterMetrics " + DateTime.Now);
            string metricurl = MySettings.metricpath.Replace("REPLACEME", item.Id);
            var    json      = GetJsonData.GetJson(metricurl, MySettings.token);

            item.Servers = json["items"].ToObject <List <Server> >();
        }
コード例 #3
0
        private static void GetNodes(Cluster item)
        {
            //Console.WriteLine("GetNodes " + DateTime.Now);
            string metricurl = MySettings.nodesurl.Replace("REPLACEME", item.Id);
            var    json      = GetJsonData.GetJson(metricurl, MySettings.token);
            var    nodes     = json.ToObject <List <Node> >();

            item.Nodes = nodes.Where(np => np.worker).ToList();
        }
コード例 #4
0
        public static void GetNodes(NodePool item)
        {
            string metricurl = MySettings.nodesurl.Replace("REPLACEME", item.clusterId);
            var    json      = GetJsonData.GetJson(metricurl, MySettings.token);
            var    nodes     = json["data"].ToObject <List <Node> >();

            item.Nodes          = nodes.Where(np => np.worker).ToList();
            item.quantity       = item.Nodes.Count;
            item.activequantity = 0;
            foreach (var active in item.Nodes)
            {
                if (active.state == "active")
                {
                    item.activequantity++;
                }
            }
        }