Package com.oracle.coherence.grpc.proxy
Class GrpcConnectionMetrics
- java.lang.Object
-
- com.oracle.coherence.grpc.proxy.GrpcConnectionMetrics
-
public class GrpcConnectionMetrics extends Object
A holder for gRPC connection metrics.This is a singleton so that one instance can track all connections in a process.
Because there is no way to actually track gRPC connections this holder tracks them using the remote address in the request header, so each unique address is a connection.
As there is no tracking of connection closed the connection metrics will expire and be removed after a period of inactivity. The default is five minutes, but this may be changed using the
PROP_CONNECTION_TTL
system property.- Author:
- Jonathan Knight 2020.10.16
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
GrpcConnectionMetrics.ConnectionMetricsMBean
A MBean to track gRPC connections.
-
Field Summary
Fields Modifier and Type Field Description static String
MBEAN_PREFIX
The connection MBean ObjectName prefix.static String
MBEAN_TYPE
The connection MBean type.static String
PROP_CONNECTION_TTL
The system property used to set the expiry time used to evict connection MBeans when connections have had no activity for a period of time.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GrpcConnectionMetrics
getInstance()
Returns the singleton instance ofGrpcConnectionMetrics
.void
register(io.grpc.ServerCall<?,?> call)
Register aServerCall
with the connection metrics, creating a new connection metric if this call is from a new remote address.
-
-
-
Field Detail
-
PROP_CONNECTION_TTL
public static final String PROP_CONNECTION_TTL
The system property used to set the expiry time used to evict connection MBeans when connections have had no activity for a period of time.- See Also:
- Constant Field Values
-
MBEAN_TYPE
public static final String MBEAN_TYPE
The connection MBean type.- See Also:
- Constant Field Values
-
MBEAN_PREFIX
public static final String MBEAN_PREFIX
The connection MBean ObjectName prefix.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static GrpcConnectionMetrics getInstance()
Returns the singleton instance ofGrpcConnectionMetrics
.- Returns:
- the singleton instance of
GrpcConnectionMetrics
-
register
public void register(io.grpc.ServerCall<?,?> call)
Register aServerCall
with the connection metrics, creating a new connection metric if this call is from a new remote address.- Parameters:
call
- theServerCall
to register
-
-