public class MqttHTTPServer extends Object implements Closeable
Example Usage:
MqttHTTPServer server = new MqttHTTPServer(1234);
| 限定符和类型 | 类和说明 |
|---|---|
static class |
MqttHTTPServer.Builder
We keep the original constructors of
MqttHTTPServer for compatibility, but new configuration
parameters like sampleNameFilter must be configured using the Builder. |
static class |
MqttHTTPServer.HTTPMetricHandler
Handles Metrics collections from the given registry.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected ExecutorService |
executorService |
protected com.sun.net.httpserver.HttpServer |
server |
| 构造器和说明 |
|---|
MqttHTTPServer(com.sun.net.httpserver.HttpServer httpServer,
io.prometheus.client.CollectorRegistry registry,
boolean daemon)
Start an HTTP server serving Prometheus metrics from the given registry using the given
HttpServer. |
MqttHTTPServer(InetSocketAddress addr,
io.prometheus.client.CollectorRegistry registry)
Start an HTTP server serving Prometheus metrics from the given registry using non-daemon threads.
|
MqttHTTPServer(InetSocketAddress addr,
io.prometheus.client.CollectorRegistry registry,
boolean daemon)
Start an HTTP server serving Prometheus metrics from the given registry.
|
MqttHTTPServer(int port)
Start an HTTP server serving the default Prometheus registry using non-daemon threads.
|
MqttHTTPServer(int port,
boolean daemon)
Start an HTTP server serving the default Prometheus registry.
|
MqttHTTPServer(String host,
int port)
Start an HTTP server serving the default Prometheus registry using non-daemon threads.
|
MqttHTTPServer(String host,
int port,
boolean daemon)
Start an HTTP server serving the default Prometheus registry.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Stop the HTTPServer.
|
int |
getPort()
Gets the port number.
|
protected static Set<String> |
parseQuery(String query) |
protected static boolean |
shouldUseCompression(com.sun.net.httpserver.HttpExchange exchange) |
protected final com.sun.net.httpserver.HttpServer server
protected final ExecutorService executorService
public MqttHTTPServer(com.sun.net.httpserver.HttpServer httpServer,
io.prometheus.client.CollectorRegistry registry,
boolean daemon)
throws IOException
HttpServer.
The httpServer is expected to already be bound to an addressIOExceptionpublic MqttHTTPServer(InetSocketAddress addr, io.prometheus.client.CollectorRegistry registry, boolean daemon) throws IOException
IOExceptionpublic MqttHTTPServer(InetSocketAddress addr, io.prometheus.client.CollectorRegistry registry) throws IOException
IOExceptionpublic MqttHTTPServer(int port,
boolean daemon)
throws IOException
IOExceptionpublic MqttHTTPServer(int port)
throws IOException
IOExceptionpublic MqttHTTPServer(String host, int port, boolean daemon) throws IOException
IOExceptionpublic MqttHTTPServer(String host, int port) throws IOException
IOExceptionprotected static boolean shouldUseCompression(com.sun.net.httpserver.HttpExchange exchange)
protected static Set<String> parseQuery(String query) throws IOException
IOExceptionpublic void close()
close 在接口中 Closeableclose 在接口中 AutoCloseablepublic int getPort()
Copyright © 2023 The Apache Software Foundation. All rights reserved.