Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void start() throws Throwable
        public override void Start()
        {
            if (Server == null)
            {
                Server = new PrometheusHttpServer(_hostnamePort.Host, _hostnamePort.Port);
                _portRegister.register("prometheus", Server.Address);
                _logger.info("Started publishing Prometheus metrics at http://" + Server.Address + "/metrics");
            }
        }
Example #2
0
        public override void Stop()
        {
            if (Server != null)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String address = server.getAddress().toString();
                string address = Server.Address.ToString();
                Server.stop();
                Server = null;
                _logger.info("Stopped Prometheus endpoint at http://" + address + "/metrics");
            }
        }