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_TTLsystem property.- Author:
- Jonathan Knight 2020.10.16
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceGrpcConnectionMetrics.ConnectionMetricsMBeanA MBean to track gRPC connections.
 - 
Field SummaryFields Modifier and Type Field Description static StringMBEAN_PREFIXThe connection MBean ObjectName prefix.static StringMBEAN_TYPEThe connection MBean type.static StringPROP_CONNECTION_TTLThe 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 SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GrpcConnectionMetricsgetInstance()Returns 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 Detail- 
PROP_CONNECTION_TTLpublic 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_TYPEpublic static final String MBEAN_TYPE The connection MBean type.- See Also:
- Constant Field Values
 
 - 
MBEAN_PREFIXpublic static final String MBEAN_PREFIX The connection MBean ObjectName prefix.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getInstancepublic static GrpcConnectionMetrics getInstance() Returns the singleton instance ofGrpcConnectionMetrics.- Returns:
- the singleton instance of GrpcConnectionMetrics
 
 - 
registerpublic 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- the- ServerCallto register
 
 
- 
 
-