コード例 #1
0
        public void CreateCustomMonitor()
        {
            authentication = new Authentication(apiKey: MonitisAccountInformation.ApiKey,
                                              secretKey: MonitisAccountInformation.SekretKey);
            customMonitor = new CustomMonitor();
            customMonitor.SetAuthenticationParams(authentication);
            agent = new CustomUserAgent();
            agent.SetAuthenticationParams(authentication);

            var a1 = agent.AddAgent("TestAgent1" + DateTime.Now.Ticks.ToString(), "internal", new JObject(), 100000, OutputType.JSON);
            _agentID = JObject.Parse(a1.Content).Value<int>("data");

            customMonitor = new CustomMonitor();
            customMonitor.SetAuthenticationParams(authentication);

            MonitorParameter param = new MonitorParameter("param1", "param1d", "val", DataType.String, false);
            MonResultParameter resParam = new MonResultParameter("MonResparam1", "MonResparam1d", "MonResval",
                                                                 DataType.String);
            MonResultParameter resAddParam = new MonResultParameter("MonAddResparam1", "MonAddResparam1d",
                                                                    "MonAddResval", DataType.String);

            var s = customMonitor.AddMonitor(_agentID, TestCustomMonitorName + DateTime.Now.Ticks.ToString(), "Test", "internal",
                                             new List<MonitorParameter>() { param },
                                             new List<MonResultParameter>() { resParam },
                                             new List<MonResultParameter>() { resAddParam });
            _customMonitorID = JObject.Parse(s.Content).Value<int>("data");

            GetTestMonitor();
        }
コード例 #2
0
 public MonitisClrMethodInfoAnalizer(Authentication authentification)
 {
     _monitor = new CustomMonitor();
     _monitor.SetAuthenticationParams(authentification);
     _agent = new CustomUserAgent();
     _agent.SetAuthenticationParams(authentification);
 }
コード例 #3
0
        private void CreateCustomUserAgent()
        {
            authentication = new Authentication(apiKey: MonitisAccountInformation.ApiKey,
                                              secretKey: MonitisAccountInformation.SekretKey);

            _agent = new CustomUserAgent();
            _agent.SetAuthenticationParams(authentication);

            var a1 = _agent.AddAgent("agent" + DateTime.Now.Ticks.ToString(), "internal", new JObject(), 100000, OutputType.JSON);
            _agentID = JObject.Parse(a1.Content).Value<int>("data");
        }
コード例 #4
0
        private void CreateCustomUserAgent()
        {
            authentication = new Authentication(apiKey: MonitisAccountInformation.ApiKey,
                                                secretKey: MonitisAccountInformation.SekretKey);

            _agent = new CustomUserAgent();
            _agent.SetAuthenticationParams(authentication);

            var a1 = _agent.AddAgent("agent" + DateTime.Now.Ticks.ToString(), "internal", new JObject(), 100000, OutputType.JSON);

            _agentID = JObject.Parse(a1.Content).Value <int>("data");
        }
コード例 #5
0
        public void CreateCustomMonitor()
        {
            authentication = new Authentication(apiKey: MonitisAccountInformation.ApiKey,
                                                secretKey: MonitisAccountInformation.SekretKey);
            customMonitor = new CustomMonitor();
            customMonitor.SetAuthenticationParams(authentication);
            agent = new CustomUserAgent();
            agent.SetAuthenticationParams(authentication);

            var a1 = agent.AddAgent("TestAgent1" + DateTime.Now.Ticks.ToString(), "internal", new JObject(), 100000, OutputType.JSON);

            _agentID = JObject.Parse(a1.Content).Value <int>("data");

            customMonitor = new CustomMonitor();
            customMonitor.SetAuthenticationParams(authentication);

            MonitorParameter   param    = new MonitorParameter("param1", "param1d", "val", DataType.String, false);
            MonResultParameter resParam = new MonResultParameter("MonResparam1", "MonResparam1d", "MonResval",
                                                                 DataType.String);
            MonResultParameter resAddParam = new MonResultParameter("MonAddResparam1", "MonAddResparam1d",
                                                                    "MonAddResval", DataType.String);

            var s = customMonitor.AddMonitor(_agentID, TestCustomMonitorName + DateTime.Now.Ticks.ToString(), "Test", "internal",
                                             new List <MonitorParameter>()
            {
                param
            },
                                             new List <MonResultParameter>()
            {
                resParam
            },
                                             new List <MonResultParameter>()
            {
                resAddParam
            });

            _customMonitorID = JObject.Parse(s.Content).Value <int>("data");


            GetTestMonitor();
        }