Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: James Rodewig <[email protected]>
  • Loading branch information
pnwpedro and jrodewig authored Nov 6, 2024
1 parent 3311626 commit 11f200b
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 37 deletions.
67 changes: 45 additions & 22 deletions src/main/java/com/fauna/client/QueryStatsSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#tro">Transactional
* Read Operations (TROs)</a> consumed
* by the requests.
* @param computeOps Aggregate <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#tco">Transactional
* Compute Operations (TCOs)</a>
* consumed by the requests.
* @param writeOps Aggregate <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#two">Transactional
* Write Operations (TWOs)</a>
* consumed by the requests.
* @param queryTimeMs Aggregate query run time for the
* requests in milliseconds.
* @param contentionRetries Aggregate number of
* <a href="https://docs.fauna.com/fauna/current/learn/transactions/contention/#retries">retries
* for contended transactions</a>.
* @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
* <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#throughput-limits">plan
* throughput limits</a> for
* <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#tro">Transactional
* Read Operations (TROs)</a>.
* @param rateLimitedComputeQueryCount Aggregate count of requests that
* exceeded
* <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#throughput-limits">plan
* throughput limits</a> for
* <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#tro">Transactional
* Compute Operations (TCOs)</a>.
* @param rateLimitedWriteQueryCount Aggregate count of requests that
* exceeded
* <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#throughput-limits">plan
* throughput limits</a> for
* <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#tro">Transactional
* Write Operations (TWOs)</a>.
*/
public QueryStatsSummary(
final long readOps,
Expand Down Expand Up @@ -70,7 +93,7 @@ public QueryStatsSummary(
}

/**
* Gets the aggregate Transactional Read Operations (TROs) recorded.
* Gets the aggregate <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#tro">Transactional Read Operations (TROs)</a> recorded.
*
* @return A long representing the aggregate read ops
*/
Expand All @@ -79,7 +102,7 @@ public long getReadOps() {
}

/**
* Gets the aggregate Transactional Compute Operations (TCOs) recorded.
* Gets the aggregate <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#tco">Transactional Compute Operations (TCOs)</a> recorded.
*
* @return A long representing the aggregate compute ops
*/
Expand All @@ -88,7 +111,7 @@ public long getComputeOps() {
}

/**
* Gets the aggregate Transactional Write Operations (TWOs) recorded.
* Gets the aggregate <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#two">Transactional Write Operations (TWOs)</a>) recorded.
*
* @return A long representing the aggregate write ops
*/
Expand Down Expand Up @@ -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.
Expand Down
40 changes: 25 additions & 15 deletions src/main/java/com/fauna/response/QueryStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#tco">Transactional
* Compute Operations (TCOs)</a> consumed by the request.
* @param readOps <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#tro">Transactional
* Read Operations (TROs)</a> consumed by the request.
* @param writeOps <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#two">Transactional
* Write Operations (TROs)</a> consumed by the request.
* @param queryTimeMs Query run time for the request in milliseconds.
* @param contentionRetries Number of <a href="https://docs.fauna.com/fauna/current/learn/transactions/contention/#retries">retries
* for contended transactions</a>
* @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
* <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#throughput-limits">plan
* throughput limits</a>.
*/
public QueryStats(final int computeOps, final int readOps,
final int writeOps,
Expand Down Expand Up @@ -66,7 +74,7 @@ public int getComputeOps() {
}

/**
* Gets the Transactional Read Operations (TROs) recorded.
* Gets the <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#tro">Transactional Read Operations (TROs)</a> recorded.
*
* @return An int representing the read ops.
*/
Expand All @@ -75,7 +83,7 @@ public int getReadOps() {
}

/**
* Gets the Transactional Write Operations (TWOs) recorded.
* Gets the <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#two">Transactional Write Operations (TWOs)</a> recorded.
*
* @return An int representing the write ops.
*/
Expand All @@ -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.
*/
Expand All @@ -103,7 +111,8 @@ public int getProcessingTimeMs() {
}

/**
* Gets the number of retries due to transaction contention.
* Gets the number of <a href="https://docs.fauna.com/fauna/current/learn/transactions/contention/#retries">retries
* for transaction contention</a>.
*
* @return An int representing the number of transaction contention retries.
*/
Expand All @@ -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 <a href="https://docs.fauna.com/fauna/current/manage/plans-billing/plan-details/#throughput-limits">plan
* throughput limits</a>.
*
* @return A list of operations that exceeded their rate limit.
* @return A list of operation types that exceeded their throughput limit.
*/
public List<String> getRateLimitsHit() {
return rateLimitsHit;
Expand Down

0 comments on commit 11f200b

Please sign in to comment.