-
Notifications
You must be signed in to change notification settings - Fork 24
Add client statistics. #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Stats are collected on the client application, when system property -Dcom.oracle.nosql.sdk.nosqldriver.stats.profile=[regular|full] is used, for an interval of time, set by -Dcom.oracle.nosql.sdk.nosqldriver.stats.interval=600 in seconds. The following stats are collected for each type of request: count, wire latencies, request and response sizes, errors, retries, retry delay, rate limit delay. Also if rateLimiting is enabled and concurent connections number. StatsConfig also provides an API to programaticaly configure the statistics collection, to selectively start and stop collection and get access to collected statistics.
Fixed throttle counter bug. Misc javadoc and clearer param and var names.
- renamed methods and fields - create full stats structure at the beginning to avoid sync locks. - switched avg calculation based on sum to be more accurate for smaller number of samples. - encapsulated writes and reads into their classes for moving sync on methods.
Updated javadoc.
Updated javadoc.
Adding detailed per query stats into the new profile. Renamed wireLatency to networkLatency, included Ms suffix for latency and delay entries to describe millisecond unit. Renamed reqSize and resSize to requestSize and resultSize. Add a stats log entry at end, just before shutdown. Fixed several javadoc params and added a sample output. Avoid NPE for Prepared statements without a driverPlan. Get statement from QueryRequest when available inside the prepared statement.
Renamed wireLatency to networkLatency. Using capital L for long numerals. Fix initial message to conform to JSON.
| /** | ||
| * Returns configuration object for statistics. | ||
| * Statistics, when enabled, contain information like errors, delays, retries | ||
| * and wire latency agregated on types of requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: agregated
| * } | ||
| * </code></p> | ||
| */ | ||
| public interface StatsConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is StatsConfig an interface? It seems like an unnecessary abstraction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To hide away implementation details and avoid user distractions.
|
I still have some general comments:
|
After reading this again, I agree with George. StatsConfig should just be a class. No need for an Impl. |
|
I'm also confused about what the extra query stats are storing. Can you talk about them? I didn't expect stats per statement that would include the statement and driver side query plan |
The query request stats are too generic when trying to find out what query is doing something significant. The extra query stats show the query stats on a per query statement base. This way certain query can be identified by checking its stats. |
StatsConfig is the interface that allows users to enable/disable the collection of stats and set which stats to collect. It is live because users can start/stop or change collection at anytime, useful for debugging hard to reproduce or transitory issues.
Adding a getName() would be another way to do it.
|
…o StatsControl. Added copyright comments to new files. Renamed: count to httpRequestCount, networkLatencyMs to httpRequestLatencyMs, countAPI to count for query requests and stmt to query. Added stacktrace to log when there is an exception during stats logging. Using request.getName() for all request types.
|
@cezarfx There are javadoc warnings in mvn. See "mvn javadoc:javadoc" |
| public class StatsControlImpl | ||
| implements StatsControl { | ||
|
|
||
| static public final String LOG_PREFIX = "ONJS:Monitoring stats|"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did this prefix come from? It seems a bit awkward. Why not just something simple like "STATS" or "STATISTICS" ?
Fix javadoc errors and warnings.
Changes StatsHandler to accept MapValue instead of FieldValue. Fixed javadoc.
Stats are collected on the client application, when system property
-Dcom.oracle.nosql.sdk.nosqldriver.stats.profile=[regular|full] is used,
for an interval of time, set by
-Dcom.oracle.nosql.sdk.nosqldriver.stats.interval=600 in seconds.
The following stats are collected for each type of request: count,
wire latencies, request and response sizes, errors, retries, retry delay,
rate limit delay. Also if rateLimiting is enabled and concurrent connections
number.
StatsConfig also provides an API to programmatically configure the statistics
collection, to selectively start and stop collection and get access to
collected statistics.