From 11f200b8f5834134674fd18f6cec35d860bffb16 Mon Sep 17 00:00:00 2001 From: Lucas Pedroza <40873230+pnwpedro@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:04:51 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: James Rodewig --- .../com/fauna/client/QueryStatsSummary.java | 67 +++++++++++++------ .../java/com/fauna/response/QueryStats.java | 40 ++++++----- 2 files changed, 70 insertions(+), 37 deletions(-) diff --git a/src/main/java/com/fauna/client/QueryStatsSummary.java b/src/main/java/com/fauna/client/QueryStatsSummary.java index af767ff0..0b8a4a1a 100644 --- a/src/main/java/com/fauna/client/QueryStatsSummary.java +++ b/src/main/java/com/fauna/client/QueryStatsSummary.java @@ -22,24 +22,47 @@ public final class QueryStatsSummary { private final int rateLimitedWriteQueryCount; /** - * @param readOps the read ops - * @param computeOps the compute ops - * @param writeOps the write ops - * @param queryTimeMs the query time in milliseconds - * @param contentionRetries the number of retries due to - * contention - * @param storageBytesRead the number of storage bytes read - * @param storageBytesWrite the number of storage bytes written - * @param processingTimeMs the event processing time in - * milliseconds - * @param queryCount the number of queries included in the - * summary - * @param rateLimitedReadQueryCount the count of queries limited - * by read ops - * @param rateLimitedComputeQueryCount the count of queries limited - * by compute ops - * @param rateLimitedWriteQueryCount the count of queries limited - * by write ops + * @param readOps Aggregate Transactional + * Read Operations (TROs) consumed + * by the requests. + * @param computeOps Aggregate Transactional + * Compute Operations (TCOs) + * consumed by the requests. + * @param writeOps Aggregate Transactional + * Write Operations (TWOs) + * consumed by the requests. + * @param queryTimeMs Aggregate query run time for the + * requests in milliseconds. + * @param contentionRetries Aggregate number of + * retries + * for contended transactions. + * @param storageBytesRead Aggregate amount of data read from + * storage, in bytes. + * @param storageBytesWrite Aggregate amount of data written to + * storage, in bytes. + * @param processingTimeMs Aggregate event processing time in + * milliseconds. Only applies to Event + * Feed and Event Stream requests. + * @param queryCount Number of requests included in the + * summary. + * @param rateLimitedReadQueryCount Aggregate count of requests that + * exceeded + * plan + * throughput limits for + * Transactional + * Read Operations (TROs). + * @param rateLimitedComputeQueryCount Aggregate count of requests that + * exceeded + * plan + * throughput limits for + * Transactional + * Compute Operations (TCOs). + * @param rateLimitedWriteQueryCount Aggregate count of requests that + * exceeded + * plan + * throughput limits for + * Transactional + * Write Operations (TWOs). */ public QueryStatsSummary( final long readOps, @@ -70,7 +93,7 @@ public QueryStatsSummary( } /** - * Gets the aggregate Transactional Read Operations (TROs) recorded. + * Gets the aggregate Transactional Read Operations (TROs) recorded. * * @return A long representing the aggregate read ops */ @@ -79,7 +102,7 @@ public long getReadOps() { } /** - * Gets the aggregate Transactional Compute Operations (TCOs) recorded. + * Gets the aggregate Transactional Compute Operations (TCOs) recorded. * * @return A long representing the aggregate compute ops */ @@ -88,7 +111,7 @@ public long getComputeOps() { } /** - * Gets the aggregate Transactional Write Operations (TWOs) recorded. + * Gets the aggregate Transactional Write Operations (TWOs)) recorded. * * @return A long representing the aggregate write ops */ @@ -135,7 +158,7 @@ public long getStorageBytesWrite() { /** * Gets the aggregate event processing time in milliseconds. - * Applies to Streams and Feeds only. + * Applies to Event Feeds and Event Stream requests only. * * @return A long representing the aggregate processing time in * milliseconds. diff --git a/src/main/java/com/fauna/response/QueryStats.java b/src/main/java/com/fauna/response/QueryStats.java index 894f48f7..7f8159ea 100644 --- a/src/main/java/com/fauna/response/QueryStats.java +++ b/src/main/java/com/fauna/response/QueryStats.java @@ -29,15 +29,23 @@ public final class QueryStats { private String stringValue = null; /** - * @param computeOps the compute ops - * @param readOps the read ops - * @param writeOps the write ops - * @param queryTimeMs the query time in milliseconds - * @param contentionRetries the number of retries due to contention - * @param storageBytesRead the number of storage bytes read - * @param storageBytesWrite the number of storage bytes written - * @param processingTimeMs the event processing time in milliseconds - * @param rateLimitsHit the rate limits hit + * @param computeOps Transactional + * Compute Operations (TCOs) consumed by the request. + * @param readOps Transactional + * Read Operations (TROs) consumed by the request. + * @param writeOps Transactional + * Write Operations (TROs) consumed by the request. + * @param queryTimeMs Query run time for the request in milliseconds. + * @param contentionRetries Number of retries + * for contended transactions + * @param storageBytesRead Amount of data read from storage, in bytes. + * @param storageBytesWrite Amount of data written to storage, in bytes. + * @param processingTimeMs Aggregate event processing time in milliseconds. + * Only applies to Event Feed and Event Stream + * requests. + * @param rateLimitsHit Operation types that exceeded + * plan + * throughput limits. */ public QueryStats(final int computeOps, final int readOps, final int writeOps, @@ -66,7 +74,7 @@ public int getComputeOps() { } /** - * Gets the Transactional Read Operations (TROs) recorded. + * Gets the Transactional Read Operations (TROs) recorded. * * @return An int representing the read ops. */ @@ -75,7 +83,7 @@ public int getReadOps() { } /** - * Gets the Transactional Write Operations (TWOs) recorded. + * Gets the Transactional Write Operations (TWOs) recorded. * * @return An int representing the write ops. */ @@ -94,7 +102,7 @@ public int getQueryTimeMs() { /** * Gets the event processing time in milliseconds. - * Applies to Streams and Feeds only. + * Applies to Event Feeds and Event Stream requests only. * * @return An int representing the processing time in milliseconds. */ @@ -103,7 +111,8 @@ public int getProcessingTimeMs() { } /** - * Gets the number of retries due to transaction contention. + * Gets the number of retries + * for transaction contention. * * @return An int representing the number of transaction contention retries. */ @@ -130,9 +139,10 @@ public int getStorageBytesWrite() { } /** - * Gets a list of operations that exceeded their rate limit. + * Gets a list of operation types that exceeded their plan + * throughput limits. * - * @return A list of operations that exceeded their rate limit. + * @return A list of operation types that exceeded their throughput limit. */ public List getRateLimitsHit() { return rateLimitsHit;