public class HTTPServer extends Object
Example Usage:
HTTPServer server = new HTTPServer(1234);
| Modifier and Type | Field and Description |
|---|---|
protected ExecutorService |
executorService |
protected com.sun.net.httpserver.HttpServer |
server |
| Constructor and Description |
|---|
HTTPServer(com.sun.net.httpserver.HttpServer httpServer,
io.prometheus.client.CollectorRegistry registry,
boolean daemon)
Start a HTTP server serving Prometheus metrics from the given registry using the given
HttpServer. |
HTTPServer(InetSocketAddress addr,
io.prometheus.client.CollectorRegistry registry)
Start a HTTP server serving Prometheus metrics from the given registry using non-daemon threads.
|
HTTPServer(InetSocketAddress addr,
io.prometheus.client.CollectorRegistry registry,
boolean daemon)
Start a HTTP server serving Prometheus metrics from the given registry.
|
HTTPServer(int port)
Start a HTTP server serving the default Prometheus registry using non-daemon threads.
|
HTTPServer(int port,
boolean daemon)
Start a HTTP server serving the default Prometheus registry.
|
HTTPServer(String host,
int port)
Start a HTTP server serving the default Prometheus registry using non-daemon threads.
|
HTTPServer(String host,
int port,
boolean daemon)
Start a HTTP server serving the default Prometheus registry.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getPort()
Gets the port number.
|
protected static Set<String> |
parseQuery(String query) |
protected static boolean |
shouldUseCompression(com.sun.net.httpserver.HttpExchange exchange) |
void |
stop()
Stop the HTTP server.
|
protected final com.sun.net.httpserver.HttpServer server
protected final ExecutorService executorService
public HTTPServer(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 HTTPServer(InetSocketAddress addr, io.prometheus.client.CollectorRegistry registry, boolean daemon) throws IOException
IOExceptionpublic HTTPServer(InetSocketAddress addr, io.prometheus.client.CollectorRegistry registry) throws IOException
IOExceptionpublic HTTPServer(int port, boolean daemon) throws IOException
IOExceptionpublic HTTPServer(int port) throws IOException
IOExceptionpublic HTTPServer(String host, int port, boolean daemon) throws IOException
IOExceptionpublic HTTPServer(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 stop()
public int getPort()
Copyright © 2021. All rights reserved.