Skip to content
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

Segmented get metrics #1193

Merged
merged 5 commits into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ private void preProcessAndRouteRequest(RestRequest restRequest, RestResponseChan
private static RestRequestMetricsGroup getMetricsGroupForGet(FrontendMetrics frontendMetrics,
SubResource subResource) {
RestRequestMetricsGroup group = null;
if (subResource == null) {
if (subResource == null || subResource.equals(SubResource.Segment)) {
group = frontendMetrics.getBlobMetricsGroup;
} else {
switch (subResource) {
Expand Down Expand Up @@ -701,6 +701,7 @@ private Callback<Void> securityPostProcessRequestCallback(String convertedId, Re
switch (subResource) {
case BlobInfo:
case UserMetadata:
case Segment:
getCallback.markStartTime();
router.getBlob(convertedId, getCallback.options, getCallback);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,15 @@ void completeRead() {
private void updateChunkingAndSizeMetricsOnSuccessfulGet() {
routerMetrics.getBlobSizeBytes.update(bytesWritten.get());
routerMetrics.getBlobChunkCount.update(numChunksTotal);
if (options != null && options.getBlobOptions.getRange() != null) {
routerMetrics.getBlobWithRangeSizeBytes.update(bytesWritten.get());
routerMetrics.getBlobWithRangeTotalBlobSizeBytes.update(totalSize);
if (options != null) {
if (options.getBlobOptions.getRange() != null) {
routerMetrics.getBlobWithRangeSizeBytes.update(bytesWritten.get());
routerMetrics.getBlobWithRangeTotalBlobSizeBytes.update(totalSize);
}
if (options.getBlobOptions.hasBlobSegmentIdx()) {
routerMetrics.getBlobWithSegmentSizeBytes.update(bytesWritten.get());
routerMetrics.getBlobWithSegmentTotalBlobSizeBytes.update(totalSize);
}
}
if (!options.getBlobOptions.isRawMode()) {
if (numChunksTotal == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ private void trackGetBlobRateMetrics(GetBlobOptions options, boolean isEncrypted
: routerMetrics.getBlobWithRangeOperationRate;
blobWithRangeOperationRate.mark();
}
if (options.hasBlobSegmentIdx()) {
Meter blobWithRangeOperationRate = isEncrypted ? routerMetrics.getEncryptedBlobWithSegmentOperationRate
: routerMetrics.getBlobWithSegmentOperationRate;
blobWithRangeOperationRate.mark();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ public class NonBlockingRouterMetrics {
public final Meter getBlobInfoOperationRate;
public final Meter getBlobOperationRate;
public final Meter getBlobWithRangeOperationRate;
public final Meter getBlobWithSegmentOperationRate;
public final Meter deleteBlobOperationRate;
public final Meter updateBlobTtlOperationRate;
public final Meter putEncryptedBlobOperationRate;
public final Meter stitchEncryptedBlobOperationRate;
public final Meter getEncryptedBlobInfoOperationRate;
public final Meter getEncryptedBlobOperationRate;
public final Meter getEncryptedBlobWithRangeOperationRate;
public final Meter getEncryptedBlobWithSegmentOperationRate;
public final Meter operationQueuingRate;
public final Meter operationDequeuingRate;
public final Meter getBlobNotOriginateLocalOperationRate;
Expand Down Expand Up @@ -84,11 +86,13 @@ public class NonBlockingRouterMetrics {
public final Counter getBlobInfoErrorCount;
public final Counter getBlobErrorCount;
public final Counter getBlobWithRangeErrorCount;
public final Counter getBlobWithSegmentErrorCount;
public final Counter putEncryptedBlobErrorCount;
public final Counter stitchEncryptedBlobErrorCount;
public final Counter getEncryptedBlobInfoErrorCount;
public final Counter getEncryptedBlobErrorCount;
public final Counter getEncryptedBlobWithRangeErrorCount;
public final Counter getEncryptedBlobWithSegmentErrorCount;
public final Counter deleteBlobErrorCount;
public final Counter updateBlobTtlErrorCount;
public final Counter operationAbortCount;
Expand Down Expand Up @@ -160,7 +164,9 @@ public class NonBlockingRouterMetrics {
public final Histogram getBlobSizeBytes;
public final Histogram getBlobChunkCount;
public final Histogram getBlobWithRangeSizeBytes;
public final Histogram getBlobWithSegmentSizeBytes;
public final Histogram getBlobWithRangeTotalBlobSizeBytes;
public final Histogram getBlobWithSegmentTotalBlobSizeBytes;
public final Counter simpleBlobPutCount;
public final Counter simpleBlobGetCount;
public final Counter compositeBlobPutCount;
Expand Down Expand Up @@ -206,6 +212,8 @@ public NonBlockingRouterMetrics(ClusterMap clusterMap, RouterConfig routerConfig
getBlobOperationRate = metricRegistry.meter(MetricRegistry.name(GetBlobOperation.class, "GetBlobOperationRate"));
getBlobWithRangeOperationRate =
metricRegistry.meter(MetricRegistry.name(GetBlobOperation.class, "GetBlobWithRangeOperationRate"));
getBlobWithSegmentOperationRate =
metricRegistry.meter(MetricRegistry.name(GetBlobOperation.class, "GetBlobWithSegmentOperationRate"));
putEncryptedBlobOperationRate =
metricRegistry.meter(MetricRegistry.name(PutOperation.class, "PutEncryptedBlobOperationRate"));
stitchEncryptedBlobOperationRate =
Expand All @@ -216,6 +224,8 @@ public NonBlockingRouterMetrics(ClusterMap clusterMap, RouterConfig routerConfig
metricRegistry.meter(MetricRegistry.name(GetBlobOperation.class, "GetEncryptedBlobOperationRate"));
getEncryptedBlobWithRangeOperationRate =
metricRegistry.meter(MetricRegistry.name(GetBlobOperation.class, "GetEncryptedBlobWithRangeOperationRate"));
getEncryptedBlobWithSegmentOperationRate =
metricRegistry.meter(MetricRegistry.name(GetBlobOperation.class, "GetEncryptedBlobWithSegmentOperationRate"));
deleteBlobOperationRate =
metricRegistry.meter(MetricRegistry.name(DeleteOperation.class, "DeleteBlobOperationRate"));
updateBlobTtlOperationRate =
Expand Down Expand Up @@ -270,6 +280,8 @@ public NonBlockingRouterMetrics(ClusterMap clusterMap, RouterConfig routerConfig
getBlobErrorCount = metricRegistry.counter(MetricRegistry.name(GetBlobOperation.class, "GetBlobErrorCount"));
getBlobWithRangeErrorCount =
metricRegistry.counter(MetricRegistry.name(GetBlobOperation.class, "GetBlobWithRangeErrorCount"));
getBlobWithSegmentErrorCount =
metricRegistry.counter(MetricRegistry.name(GetBlobOperation.class, "GetBlobWithSegmentErrorCount"));
putEncryptedBlobErrorCount =
metricRegistry.counter(MetricRegistry.name(PutOperation.class, "PutEncryptedBlobErrorCount"));
stitchEncryptedBlobErrorCount =
Expand All @@ -280,6 +292,8 @@ public NonBlockingRouterMetrics(ClusterMap clusterMap, RouterConfig routerConfig
metricRegistry.counter(MetricRegistry.name(GetBlobOperation.class, "GetEncryptedBlobErrorCount"));
getEncryptedBlobWithRangeErrorCount =
metricRegistry.counter(MetricRegistry.name(GetBlobOperation.class, "GetEncryptedBlobWithRangeErrorCount"));
getEncryptedBlobWithSegmentErrorCount =
metricRegistry.counter(MetricRegistry.name(GetBlobOperation.class, "GetEncryptedBlobWithSegmentErrorCount"));
deleteBlobErrorCount = metricRegistry.counter(MetricRegistry.name(DeleteOperation.class, "DeleteBlobErrorCount"));
updateBlobTtlErrorCount =
metricRegistry.counter(MetricRegistry.name(TtlUpdateOperation.class, "UpdateBlobTtlErrorCount"));
Expand Down Expand Up @@ -381,8 +395,12 @@ public NonBlockingRouterMetrics(ClusterMap clusterMap, RouterConfig routerConfig
getBlobChunkCount = metricRegistry.histogram(MetricRegistry.name(GetManager.class, "GetBlobChunkCount"));
getBlobWithRangeSizeBytes =
metricRegistry.histogram(MetricRegistry.name(GetBlobOperation.class, "GetBlobWithRangeSizeBytes"));
getBlobWithSegmentSizeBytes =
metricRegistry.histogram(MetricRegistry.name(GetBlobOperation.class, "GetBlobWithSegmentSizeBytes"));
getBlobWithRangeTotalBlobSizeBytes =
metricRegistry.histogram(MetricRegistry.name(GetBlobOperation.class, "GetBlobWithRangeTotalBlobSizeBytes"));
getBlobWithSegmentTotalBlobSizeBytes =
metricRegistry.histogram(MetricRegistry.name(GetBlobOperation.class, "GetBlobWithSegmentTotalBlobSizeBytes"));
simpleBlobPutCount = metricRegistry.counter(MetricRegistry.name(PutManager.class, "SimpleBlobPutCount"));
simpleBlobGetCount = metricRegistry.counter(MetricRegistry.name(GetManager.class, "SimpleBlobGetCount"));
compositeBlobPutCount = metricRegistry.counter(MetricRegistry.name(PutManager.class, "CompositeBlobPutCount"));
Expand Down Expand Up @@ -685,11 +703,18 @@ private void onGetBlobDataError(Exception e, GetBlobOptionsInternal options, boo
onError(e);
Counter blobErrorCount = encrypted ? getEncryptedBlobErrorCount : getBlobErrorCount;
Counter blobWithRangeErrorCount = encrypted ? getEncryptedBlobWithRangeErrorCount : getBlobWithRangeErrorCount;
Counter blobWithSegmentErrorCount =
encrypted ? getEncryptedBlobWithSegmentErrorCount : getBlobWithSegmentErrorCount;
Meter operationErrorRateMeter = encrypted ? encryptedOperationErrorRate : operationErrorRate;
if (RouterUtils.isSystemHealthError(e)) {
blobErrorCount.inc();
if (options != null && options.getBlobOptions.getRange() != null) {
blobWithRangeErrorCount.inc();
if (options != null) {
if (options.getBlobOptions.getRange() != null) {
blobWithRangeErrorCount.inc();
}
if (options.getBlobOptions.hasBlobSegmentIdx()) {
blobWithSegmentErrorCount.inc();
}
}
operationErrorRateMeter.mark();
}
Expand Down