public class WebServer extends Object implements sirius.kernel.Startable, sirius.kernel.Stoppable, sirius.kernel.Killable, sirius.kernel.health.metrics.MetricProvider
Modifier and Type | Class and Description |
---|---|
static class |
WebServer.BandwidthUpdater
Updates the measured bandwidth of all open http(s) connections.
|
static class |
WebServer.MicrotimingMode
Determines how the web server should participate in the microtiming framework.
|
Modifier and Type | Field and Description |
---|---|
protected static long |
blocks |
protected static long |
bytesIn |
protected static long |
bytesOut |
protected static long |
chunks |
protected static long |
clientErrors |
protected static long |
connections |
protected static long |
idleTimeouts |
protected static long |
keepalives |
static int |
LIFECYCLE_PRIORITY
Determines the priority of the start of the web server.
|
static sirius.kernel.health.Log |
LOG
Used to log all web / http relevant messages
|
protected static long |
messagesIn |
protected static long |
messagesOut |
protected static WebServer.MicrotimingMode |
microtimingMode |
protected static Map<sirius.web.http.WebServerHandler,sirius.web.http.WebServerHandler> |
openConnections |
protected static long |
requests |
protected static sirius.kernel.health.Average |
responseTime |
protected static long |
serverErrors |
protected static sirius.kernel.health.Average |
timeToFirstByte |
protected static long |
websockets |
Constructor and Description |
---|
WebServer() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addOpenConnection(sirius.web.http.WebServerHandler webServerHandler) |
void |
awaitTermination() |
void |
gather(sirius.kernel.health.metrics.MetricsCollector collector) |
static double |
getAvgResponseTime()
Returns the average response time of the last requests.
|
static double |
getAvgTimeToFirstByte()
Returns the average time required to generate a response.
|
static long |
getBlockedConnections()
Returns the total number of connections blocked so far
|
static long |
getBytesIn()
Returns the total bytes received so far
|
static long |
getBytesOut()
Returns the total bytes sent so far
|
static long |
getChunks()
Returns the total number of HTTP chunks received
|
static long |
getClientErrors()
Returns the number of HTTP responses with an 4xx status code.
|
static long |
getConnections()
Returns the total number of connections opened so far
|
protected static HttpDataFactory |
getHttpDataFactory()
Returns the data factory used to handle file uploads and posts.
|
static long |
getIdleTimeouts()
Returns the number of idle connections killed
|
protected static IPRange.RangeSet |
getIPFilter()
Returns an ip filter which determines which IPs may connect to the web server.
|
static long |
getKeepalives()
Returns the number of keepalives supported
|
protected static long |
getMaxTimeToFirstByte()
Returns the maximal tolerated time it takes to create a response (send the first byte).
|
protected static long |
getMaxUploadSize()
Returns the maximal upload size in bytes
|
static long |
getMessagesIn()
Returns the total messages (packets) sent so far
|
static long |
getMessagesOut()
Returns the total messages (packets) received so far
|
static WebServer.MicrotimingMode |
getMicrotimingMode()
Returns the
WebServer.MicrotimingMode used by the web server |
protected static long |
getMinUploadFreespace()
Returns the minimal value of free disk space accepted until an upload is aborted.
|
static long |
getNumberOfOpenConnections()
Returns the number of currently open connection
|
static long |
getNumberOfWebsockets()
Returns the number of currently open websockets
|
static Collection<ActiveHTTPConnection> |
getOpenConnections()
Returns all currently open connections of the HTTP server.
|
static int |
getPort()
Returns the port used by the web server
|
int |
getPriority() |
protected static IPRange.RangeSet |
getProxyIPs()
Returns all proxy IPs as
IPRange.RangeSet |
static long |
getRequests()
Returns the total number of HTTP requests received by the web server
|
static long |
getServerErrors()
Returns the number of HTTP responses with an 5xx status code.
|
protected static IPRange.RangeSet |
getTrustedRanges()
Returns all trusted IPs as
IPRange.RangeSet |
protected static void |
removeOpenConnection(sirius.web.http.WebServerHandler webServerHandler) |
static void |
setMicrotimingMode(WebServer.MicrotimingMode microtimingMode)
Changes the microtiming mode.
|
void |
started() |
void |
stopped() |
public static final int LIFECYCLE_PRIORITY
public static final sirius.kernel.health.Log LOG
protected static volatile long bytesIn
protected static volatile long bytesOut
protected static volatile long messagesIn
protected static volatile long messagesOut
protected static volatile long connections
protected static volatile long blocks
protected static volatile long requests
protected static volatile long chunks
protected static volatile long keepalives
protected static volatile long idleTimeouts
protected static volatile long clientErrors
protected static volatile long serverErrors
protected static volatile long websockets
protected static Map<sirius.web.http.WebServerHandler,sirius.web.http.WebServerHandler> openConnections
protected static sirius.kernel.health.Average responseTime
protected static sirius.kernel.health.Average timeToFirstByte
protected static volatile WebServer.MicrotimingMode microtimingMode
public static int getPort()
protected static IPRange.RangeSet getIPFilter()
protected static IPRange.RangeSet getTrustedRanges()
IPRange.RangeSet
protected static IPRange.RangeSet getProxyIPs()
IPRange.RangeSet
IPRange.RangeSet
permit to name several, even sub nets. If a request comes from a proxy IP
its X-Forwarded-For header is checked for the original IP.protected static long getMinUploadFreespace()
protected static long getMaxUploadSize()
protected static long getMaxTimeToFirstByte()
protected static HttpDataFactory getHttpDataFactory()
public int getPriority()
getPriority
in interface sirius.kernel.di.std.Priorized
getPriority
in interface sirius.kernel.Killable
getPriority
in interface sirius.kernel.Startable
getPriority
in interface sirius.kernel.Stoppable
public void started()
started
in interface sirius.kernel.Startable
public void stopped()
stopped
in interface sirius.kernel.Stoppable
public void awaitTermination()
awaitTermination
in interface sirius.kernel.Killable
public static long getBytesIn()
public static long getBytesOut()
public static long getMessagesIn()
public static long getMessagesOut()
public static long getConnections()
public static long getBlockedConnections()
public static long getNumberOfOpenConnections()
public static long getNumberOfWebsockets()
public static long getRequests()
public static long getChunks()
public static long getKeepalives()
public static long getIdleTimeouts()
public static long getClientErrors()
public static long getServerErrors()
public static double getAvgResponseTime()
public static double getAvgTimeToFirstByte()
public void gather(sirius.kernel.health.metrics.MetricsCollector collector)
gather
in interface sirius.kernel.health.metrics.MetricProvider
protected static void addOpenConnection(sirius.web.http.WebServerHandler webServerHandler)
protected static void removeOpenConnection(sirius.web.http.WebServerHandler webServerHandler)
public static Collection<ActiveHTTPConnection> getOpenConnections()
public static WebServer.MicrotimingMode getMicrotimingMode()
WebServer.MicrotimingMode
used by the web serverMicrotiming
public static void setMicrotimingMode(WebServer.MicrotimingMode microtimingMode)
Note that the microtiming framework still has to be enabled to generate any output.
microtimingMode
- the new microtiming mode to use.Copyright © 2018. All rights reserved.