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(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(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 © 2018. All rights reserved.