Package org.opends.server.protocols.ldap
Class LDAPStatistics
- java.lang.Object
-
- org.opends.server.api.MonitorProvider<MonitorProviderCfg>
-
- org.opends.server.protocols.ldap.LDAPStatistics
-
- Direct Known Subclasses:
HTTPStatistics
public class LDAPStatistics extends MonitorProvider<MonitorProviderCfg>
This class defines a data structure that will be used to keep track of various metrics related to LDAP communication that the server has conducted. The statistics that will be tracked include:- The total number of LDAP client connections accepted by the server.
- The total number of LDAP client connections that have been closed.
- The total number of LDAP messages read, both overall and broken down by message type.
- The total number of LDAP messages written, both overall and broken down by message type.
- The total number of bytes read from LDAP clients.
- The total number of bytes written to LDAP clients.
This class may also be used in a hierarchical form if it is desirable to get specific and general statistics at the same time (e.g., information about the interaction with a specific client or aggregated for all clients).
-
-
Constructor Summary
Constructors Constructor Description LDAPStatistics(String instanceName)Creates a new instance of this class with the specified parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearStatistics()Clears any statistical information collected to this point.longgetAbandonRequests()Retrieves the number of abandon requests that have been received.longgetAddRequests()Retrieves the number of add requests that have been received.longgetAddResponses()Retrieves the number of add responses that have been sent.longgetBindRequests()Retrieves the number of bind requests that have been received.longgetBindResponses()Retrieves the number of bind responses that have been sent.longgetBytesRead()Retrieves the number of bytes that have been received from clients.longgetBytesWritten()Retrieves the number of bytes that have been written to clients.longgetCompareRequests()Retrieves the number of compare requests that have been received.longgetCompareResponses()Retrieves the number of compare responses that have been sent.longgetConnectionsClosed()Retrieves the number of client connections that have been closed.longgetConnectionsEstablished()Retrieves the number of client connections that have been established.longgetDeleteRequests()Retrieves the number of delete requests that have been received.longgetDeleteResponses()Retrieves the number of delete responses that have been sent.longgetExtendedRequests()Retrieves the number of extended requests that have been received.longgetExtendedResponses()Retrieves the number of extended responses that have been sent.longgetMessagesRead()Retrieves the number of LDAP messages that have been received from clients.longgetMessagesWritten()Retrieves the number of LDAP messages that have been written to clients.longgetModifyDNRequests()Retrieves the number of modify DN requests that have been received.longgetModifyDNResponses()Retrieves the number of modify DN responses that have been sent.longgetModifyRequests()Retrieves the number of modify requests that have been received.longgetModifyResponses()Retrieves the number of modify responses that have been sent.MonitorDatagetMonitorData()Retrieves a set of attributes containing monitor data that should be returned to the client if the corresponding monitor entry is requested.StringgetMonitorInstanceName()Retrieves the name of this monitor provider.ObjectClassgetMonitorObjectClass()Retrieves the objectclass that should be included in the monitor entry created from this monitor provider.longgetOperationsAbandoned()Retrieves the number of operations that have been abandoned by clients.longgetOperationsCompleted()Retrieves the number of operations for which the server has completed processing.longgetOperationsInitiated()Retrieves the number of operations that have been initiated by clients.longgetSearchOneRequests()Retrieves the number of one-level search requests that have been received.longgetSearchRequests()Retrieves the number of search requests that have been received.longgetSearchResultEntries()Retrieves the number of search result entries that have been sent.longgetSearchResultReferences()Retrieves the number of search result references that have been sent.longgetSearchResultsDone()Retrieves the number of search result done messages that have been sent.longgetSearchSubRequests()Retrieves the number of subtree search requests that have been received.longgetUnbindRequests()Retrieves the number of unbind requests that have been received.voidinitializeMonitorProvider(MonitorProviderCfg configuration)Initializes this monitor provider based on the information in the provided configuration entry.voidupdateAbandonedOperation()Updates the appropriate set of counters to indicate that an operation was abandoned without sending a response to the client.voidupdateBytesRead(int bytesRead)Updates the appropriate set of counters to indicate that the specified number of bytes have been read by the client.voidupdateBytesWritten(int bytesWritten)Updates the appropriate set of counters to indicate that the specified number of bytes have been written to the client.voidupdateConnect()Updates the appropriate set of counters to indicate that a new connection has been established.voidupdateDisconnect()Updates the appropriate set of counters to indicate that a connection has been closed.voidupdateMessageRead(LDAPMessage message)Updates the appropriate set of counters based on the provided message that has been read from the client.voidupdateMessageWritten(byte messageType, int messageId)Updates the appropriate set of counters based on the provided message that has been written to the client.voidupdateMessageWritten(LDAPMessage message)Updates the appropriate set of counters based on the provided message that has been written to the client.voidupdateOperationMonitoringData(OperationType type, long time)Update the operation counters and times depending on the OperationType.-
Methods inherited from class org.opends.server.api.MonitorProvider
finalizeMonitorProvider, isConfigurationAcceptable, scheduleUpdate
-
-
-
-
Constructor Detail
-
LDAPStatistics
public LDAPStatistics(String instanceName)
Creates a new instance of this class with the specified parent.- Parameters:
instanceName- The name for this monitor provider instance.
-
-
Method Detail
-
initializeMonitorProvider
public void initializeMonitorProvider(MonitorProviderCfg configuration) throws ConfigException
Description copied from class:MonitorProviderInitializes this monitor provider based on the information in the provided configuration entry.- Overrides:
initializeMonitorProviderin classMonitorProvider<MonitorProviderCfg>- Parameters:
configuration- The configuration to use to initialize this monitor provider.- Throws:
ConfigException- If an unrecoverable problem arises in the process of performing the initialization.
-
getMonitorInstanceName
public String getMonitorInstanceName()
Retrieves the name of this monitor provider. It should be unique among all monitor providers, including all instances of the same monitor provider.- Specified by:
getMonitorInstanceNamein classMonitorProvider<MonitorProviderCfg>- Returns:
- The name of this monitor provider.
-
getMonitorObjectClass
public ObjectClass getMonitorObjectClass()
Description copied from class:MonitorProviderRetrieves the objectclass that should be included in the monitor entry created from this monitor provider. This may be overridden by subclasses that wish to include their own custom objectclass in the monitor entry (e.g., to make it easier to search for monitor entries of that type). The default implementation returns the "extensibleObject" objectclass.- Overrides:
getMonitorObjectClassin classMonitorProvider<MonitorProviderCfg>- Returns:
- The objectclass that should be included in the monitor entry created from this monitor provider.
-
getMonitorData
public MonitorData getMonitorData()
Description copied from class:MonitorProviderRetrieves a set of attributes containing monitor data that should be returned to the client if the corresponding monitor entry is requested.- Specified by:
getMonitorDatain classMonitorProvider<MonitorProviderCfg>- Returns:
- A set of attributes containing monitor data that should be returned to the client if the corresponding monitor entry is requested.
-
clearStatistics
public void clearStatistics()
Clears any statistical information collected to this point.
-
updateConnect
public void updateConnect()
Updates the appropriate set of counters to indicate that a new connection has been established.
-
updateDisconnect
public void updateDisconnect()
Updates the appropriate set of counters to indicate that a connection has been closed.
-
updateBytesRead
public void updateBytesRead(int bytesRead)
Updates the appropriate set of counters to indicate that the specified number of bytes have been read by the client.- Parameters:
bytesRead- The number of bytes read by the client.
-
updateBytesWritten
public void updateBytesWritten(int bytesWritten)
Updates the appropriate set of counters to indicate that the specified number of bytes have been written to the client.- Parameters:
bytesWritten- The number of bytes written to the client.
-
updateMessageRead
public void updateMessageRead(LDAPMessage message)
Updates the appropriate set of counters based on the provided message that has been read from the client.- Parameters:
message- The message that was read from the client.
-
updateMessageWritten
public void updateMessageWritten(byte messageType, int messageId)Updates the appropriate set of counters based on the provided message that has been written to the client.- Parameters:
messageType- The message type that was written to the client.messageId- The message id that was written to the client
-
updateMessageWritten
public void updateMessageWritten(LDAPMessage message)
Updates the appropriate set of counters based on the provided message that has been written to the client.- Parameters:
message- The message that was written to the client.
-
updateAbandonedOperation
public void updateAbandonedOperation()
Updates the appropriate set of counters to indicate that an operation was abandoned without sending a response to the client.
-
getConnectionsEstablished
public long getConnectionsEstablished()
Retrieves the number of client connections that have been established.- Returns:
- The number of client connections that have been established.
-
getConnectionsClosed
public long getConnectionsClosed()
Retrieves the number of client connections that have been closed.- Returns:
- The number of client connections that have been closed.
-
getBytesRead
public long getBytesRead()
Retrieves the number of bytes that have been received from clients.- Returns:
- The number of bytes that have been received from clients.
-
getBytesWritten
public long getBytesWritten()
Retrieves the number of bytes that have been written to clients.- Returns:
- The number of bytes that have been written to clients.
-
getMessagesRead
public long getMessagesRead()
Retrieves the number of LDAP messages that have been received from clients.- Returns:
- The number of LDAP messages that have been received from clients.
-
getMessagesWritten
public long getMessagesWritten()
Retrieves the number of LDAP messages that have been written to clients.- Returns:
- The number of LDAP messages that have been written to clients.
-
getOperationsInitiated
public long getOperationsInitiated()
Retrieves the number of operations that have been initiated by clients.- Returns:
- The number of operations that have been initiated by clients.
-
getOperationsCompleted
public long getOperationsCompleted()
Retrieves the number of operations for which the server has completed processing.- Returns:
- The number of operations for which the server has completed processing.
-
getOperationsAbandoned
public long getOperationsAbandoned()
Retrieves the number of operations that have been abandoned by clients.- Returns:
- The number of operations that have been abandoned by clients.
-
getAbandonRequests
public long getAbandonRequests()
Retrieves the number of abandon requests that have been received.- Returns:
- The number of abandon requests that have been received.
-
getAddRequests
public long getAddRequests()
Retrieves the number of add requests that have been received.- Returns:
- The number of add requests that have been received.
-
getAddResponses
public long getAddResponses()
Retrieves the number of add responses that have been sent.- Returns:
- The number of add responses that have been sent.
-
getBindRequests
public long getBindRequests()
Retrieves the number of bind requests that have been received.- Returns:
- The number of bind requests that have been received.
-
getBindResponses
public long getBindResponses()
Retrieves the number of bind responses that have been sent.- Returns:
- The number of bind responses that have been sent.
-
getCompareRequests
public long getCompareRequests()
Retrieves the number of compare requests that have been received.- Returns:
- The number of compare requests that have been received.
-
getCompareResponses
public long getCompareResponses()
Retrieves the number of compare responses that have been sent.- Returns:
- The number of compare responses that have been sent.
-
getDeleteRequests
public long getDeleteRequests()
Retrieves the number of delete requests that have been received.- Returns:
- The number of delete requests that have been received.
-
getDeleteResponses
public long getDeleteResponses()
Retrieves the number of delete responses that have been sent.- Returns:
- The number of delete responses that have been sent.
-
getExtendedRequests
public long getExtendedRequests()
Retrieves the number of extended requests that have been received.- Returns:
- The number of extended requests that have been received.
-
getExtendedResponses
public long getExtendedResponses()
Retrieves the number of extended responses that have been sent.- Returns:
- The number of extended responses that have been sent.
-
getModifyRequests
public long getModifyRequests()
Retrieves the number of modify requests that have been received.- Returns:
- The number of modify requests that have been received.
-
getModifyResponses
public long getModifyResponses()
Retrieves the number of modify responses that have been sent.- Returns:
- The number of modify responses that have been sent.
-
getModifyDNRequests
public long getModifyDNRequests()
Retrieves the number of modify DN requests that have been received.- Returns:
- The number of modify DN requests that have been received.
-
getModifyDNResponses
public long getModifyDNResponses()
Retrieves the number of modify DN responses that have been sent.- Returns:
- The number of modify DN responses that have been sent.
-
getSearchRequests
public long getSearchRequests()
Retrieves the number of search requests that have been received.- Returns:
- The number of search requests that have been received.
-
getSearchOneRequests
public long getSearchOneRequests()
Retrieves the number of one-level search requests that have been received.- Returns:
- The number of one-level search requests that have been received.
-
getSearchSubRequests
public long getSearchSubRequests()
Retrieves the number of subtree search requests that have been received.- Returns:
- The number of subtree search requests that have been received.
-
getSearchResultEntries
public long getSearchResultEntries()
Retrieves the number of search result entries that have been sent.- Returns:
- The number of search result entries that have been sent.
-
getSearchResultReferences
public long getSearchResultReferences()
Retrieves the number of search result references that have been sent.- Returns:
- The number of search result references that have been sent.
-
getSearchResultsDone
public long getSearchResultsDone()
Retrieves the number of search result done messages that have been sent.- Returns:
- The number of search result done messages that have been sent.
-
getUnbindRequests
public long getUnbindRequests()
Retrieves the number of unbind requests that have been received.- Returns:
- The number of unbind requests that have been received.
-
updateOperationMonitoringData
public void updateOperationMonitoringData(OperationType type, long time)
Update the operation counters and times depending on the OperationType.- Parameters:
type- of the operation.time- of the operation execution.
-
-