Class StatsControl
Controls collection and periodic reporting of client statistics.
Inherited Members
Namespace: Oracle.NoSQL.SDK
Assembly: Oracle.NoSQL.SDK.dll
Syntax
public abstract class StatsControl
Remarks
Statistics collection follows the same profile model as the Oracle NoSQL Java SDK. The default profile is None, which means that no statistics are collected unless enabled in NoSQLConfig or by setting a different profile and calling Start().
Example:
var statsControl = client.GetStatsControl();
statsControl
.SetProfile(StatsControl.Profile.All)
.SetPrettyPrint(true)
.SetStatsHandler(stats => Console.WriteLine(stats));
statsControl.Start();Fields
| Name | Description |
|---|---|
| LogPrefix | Prefix used for statistics log messages. |
Methods
| Name | Description |
|---|---|
| GetInterval() | Gets the configured statistics interval. |
| GetPrettyPrint() | Gets the current JSON pretty-print flag. |
| GetProfile() | Gets the current statistics collection profile. |
| GetStatsHandler() | Gets the current statistics handler. |
| IsStarted() | Gets whether statistics collection is currently active. |
| SetPrettyPrint(bool) | Enables or disables pretty printing of JSON statistics output. |
| SetProfile(Profile) | Sets the configured statistics collection profile. This method does not itself request that collection start or stop and does not rebuild an existing statistics aggregator. If Start() was previously called while the profile was None, selecting a collecting profile creates the aggregator and activates that pending start request. Request bucket capabilities such as percentile collection are fixed when the aggregator is first created. Use Stop() to disable an already-running collector before setting None. |
| SetStatsHandler(StatsHandler) | Sets the handler invoked for generated statistics snapshots. |
| Start() | Starts statistics collection. If the current profile is None, the start request is remembered but no aggregator is created and IsStarted() remains false. Selecting a collecting profile later activates collection without another call to this method. |
| Stop() | Stops collection of new statistics. For parity with the Java SDK, an existing periodic reporting scheduler remains active and may report statistics collected before this method was called. Periodic reporting ends when the owning client is disposed. Collection may be started again later while the client remains active. |