Package com.oracle.coherence.grpc.proxy
Class GrpcConnectionMetrics
java.lang.Object
com.oracle.coherence.grpc.proxy.GrpcConnectionMetrics
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 ClassesModifier and TypeClassDescriptionstatic interfaceA MBean to track gRPC connections. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe connection MBean ObjectName prefix.static final StringThe connection MBean type.static final StringThe 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
Modifier and TypeMethodDescriptionstatic GrpcConnectionMetricsReturns the singleton instance ofGrpcConnectionMetrics.voidregister(io.grpc.ServerCall<?, ?> call) Register aServerCallwith the connection metrics, creating a new connection metric if this call is from a new remote address.
-
Field Details
-
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:
-
MBEAN_TYPE
The connection MBean type.- See Also:
-
MBEAN_PREFIX
The connection MBean ObjectName prefix.- See Also:
-
-
Method Details
-
getInstance
Returns the singleton instance ofGrpcConnectionMetrics.- Returns:
- the singleton instance of
GrpcConnectionMetrics
-
register
public void register(io.grpc.ServerCall<?, ?> call) Register aServerCallwith the connection metrics, creating a new connection metric if this call is from a new remote address.- Parameters:
call- theServerCallto register
-