-
Notifications
You must be signed in to change notification settings - Fork 275
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
Refactor operation tracker ctor and introduce custom percentiles #1159
Conversation
1. refactor ctor of both simple and adaptive operation tracker by passing the router config and operation class. This allows operation tracker itself to populate its parameters based on type of operation class. 2. introduce custom percentiles of latency Histogram in adaptive operation tracker. The percentiles are configurable and on-demand. User can define arbitrary quantile like 91th percentile to better eveluate the latency distribution.
Codecov Report
@@ Coverage Diff @@
## master #1159 +/- ##
===========================================
+ Coverage 69.84% 69.94% +0.1%
- Complexity 5316 5344 +28
===========================================
Files 420 426 +6
Lines 32547 32626 +79
Branches 4139 4140 +1
===========================================
+ Hits 22732 22821 +89
+ Misses 8695 8667 -28
- Partials 1120 1138 +18
Continue to review full report at Codecov.
|
List<String> customPercentiles = | ||
Utils.splitString(verifiableProperties.getString("router.operation.tracker.custom.percentiles", ""), ","); | ||
routerOperationTrackerCustomPercentiles = | ||
Collections.unmodifiableList(customPercentiles.stream().map(Double::valueOf).collect(Collectors.toList())); |
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.
Can we convert string to list when it's needed? Previous example: storeCompactionTriggers
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.
got you. It's OK.
@@ -237,23 +237,19 @@ protected GetRequest createGetRequest(BlobId blobId, MessageFormatFlags flag, Ge | |||
/** | |||
* Gets an {@link OperationTracker} based on the config and {@code partitionId}. | |||
* @param partitionId the {@link PartitionId} for which a tracker is required. | |||
* @param operationClass |
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.
comment
./gradlew build && ./gradlew test succeeded. Reminder to review, thanks. |
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.
LGTM
return disk.getState() == HardwareState.AVAILABLE ? 1L : 0L; | ||
} | ||
}; | ||
Gauge<Long> diskState = () -> disk.getState() == HardwareState.AVAILABLE ? 1L : 0L; |
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.
Thanks for cleaning up this code!
// populate tracker parameters based on operation type | ||
boolean crossColoEnabled = false; | ||
boolean includeNonOriginatingDcReplicas = true; | ||
int replicasRequired = Integer.MAX_VALUE; |
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.
how is this local variable used?
crossColoEnabled = routerConfig.routerGetCrossDcEnabled; | ||
includeNonOriginatingDcReplicas = routerConfig.routerGetIncludeNonOriginatingDcReplicas; | ||
replicasRequired = routerConfig.routerGetReplicasRequired; | ||
} else if (operationClass == PutOperation.class) { |
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.
One other option is to make an enum to represent the operation tracker types (i.e. GET, PUT, DELETE, TTL_UPDATE). This is a little more explicit and resilient to new classes/name changes.
*/ | ||
@Config("router.operation.tracker.custom.percentiles") | ||
@Default("") | ||
public final List<Double> routerOperationTrackerCustomPercentiles; |
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.
how will these custom percentiles be used by operation tracker in the future? Right now, they are only registered in the MetricRegistry
for viewing.
Good to merge? @cgtz |
passing the router config and operation class. This allows operation
tracker itself to populate its parameters based on type of operation
class.
operation tracker. The percentiles are configurable and on-demand. User
can define arbitrary quantile like 91th percentile to better eveluate
the latency distribution.