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

[DO_NOT_MERGE] [FOR_TEST_ONLY] Modify test to check serde time for stitch for a 1TiB blob #2703

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public FrontendConfig(VerifiableProperties verifiableProperties) {
maxAcceptableTtlSecsIfTtlRequired = verifiableProperties.getIntInRange(MAX_ACCEPTABLE_TTL_SECS_IF_TTL_REQUIRED_KEY,
(int) TimeUnit.DAYS.toSeconds(30), 0, Integer.MAX_VALUE);
maxJsonRequestSizeBytes =
verifiableProperties.getIntInRange(MAX_JSON_REQUEST_SIZE_BYTES_KEY, 20 * 1024 * 1024, 0, Integer.MAX_VALUE);
verifiableProperties.getIntInRange(MAX_JSON_REQUEST_SIZE_BYTES_KEY, 134217728, 0, Integer.MAX_VALUE);
enableUndelete = verifiableProperties.getBoolean(ENABLE_UNDELETE, false);
accountStatsStoreFactory =
verifiableProperties.getString(ACCOUNT_STATS_STORE_FACTORY, DEFAULT_ACCOUNT_STATS_STORE_FACTORY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public class FrontendMetrics {
public final Histogram blobPropsBuildTimeInMs;
// NAMED BLOB PUT
public final Histogram blobPropsBuildForNameBlobPutTimeInMs;
public final Histogram namedBlobPutGetChunksToStitchTimeInMs;

// OPTIONS
public final Histogram optionsPreProcessingTimeInMs;
Expand Down Expand Up @@ -354,6 +355,7 @@ public FrontendMetrics(MetricRegistry metricRegistry, FrontendConfig frontendCon
putBlobMetricsGroup =
new RestRequestMetricsGroup(NamedBlobPutHandler.class, "PutBlob", false, metricRegistry, frontendConfig);


// AsyncOperationTracker.Metrics instances
postSecurityProcessRequestMetrics =
new AsyncOperationTracker.Metrics(PostBlobHandler.class, "postSecurityProcessRequest", metricRegistry);
Expand Down Expand Up @@ -540,6 +542,8 @@ public FrontendMetrics(MetricRegistry metricRegistry, FrontendConfig frontendCon
// NAMEDBLOBPUT
blobPropsBuildForNameBlobPutTimeInMs = metricRegistry.histogram(
MetricRegistry.name(FrontendRestRequestService.class, "blobPropsBuildForNameBlobPutTimeInMs"));
namedBlobPutGetChunksToStitchTimeInMs = metricRegistry.histogram(
MetricRegistry.name(FrontendRestRequestService.class, "NamedBlobPutGetChunksToStitchTimeInMs"));
// OPTIONS
optionsPreProcessingTimeInMs =
metricRegistry.histogram(MetricRegistry.name(FrontendRestRequestService.class, "OptionsPreProcessingTimeInMs"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ private PutBlobOptions getPutBlobOptionsFromRequest() throws RestServiceExceptio
*/
List<ChunkInfo> getChunksToStitch(BlobProperties stitchedBlobProperties, JSONObject stitchRequestJson)
throws RestServiceException {
long getChunksToStitchStartTime = System.currentTimeMillis();
String reservedMetadataBlobId = null;
List<String> signedChunkIds = StitchRequestSerDe.fromJson(stitchRequestJson);
if (signedChunkIds.isEmpty()) {
Expand Down Expand Up @@ -493,6 +494,9 @@ List<ChunkInfo> getChunksToStitch(BlobProperties stitchedBlobProperties, JSONObj
}
//the actual blob size for stitched blob is the sum of all the chunk sizes
restResponseChannel.setHeader(RestUtils.Headers.BLOB_SIZE, totalStitchedBlobSize);
long timetaken = System.currentTimeMillis() - getChunksToStitchStartTime;
frontendMetrics.namedBlobPutGetChunksToStitchTimeInMs.update(System.currentTimeMillis() - getChunksToStitchStartTime);
System.out.print("Time taken to get chunks to stitch: " + timetaken + " ms\n");
return chunksToStitch;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,18 +283,24 @@ public void stitchNamedBlobTest() throws Exception {
idConverterFactory.translation = CONVERTED_ID;
long creationTimeMs = System.currentTimeMillis();
time.setCurrentMilliseconds(creationTimeMs);
int[] chunkSizes = new int[262144];
//success case
String uploadSession = UUID.randomUUID().toString();
String[] prefixToTest = new String[]{"/" + CLUSTER_NAME, ""};
for (int i = 0; i < 262144; i++) {
chunkSizes[i] = 238;
}
for (String prefix : prefixToTest) {

// multiple chunks
List<ChunkInfo> chunksToStitch = uploadChunksViaRouter(creationTimeMs, REF_CONTAINER, 45, 10, 200, 19, 0, 50);
List<ChunkInfo> chunksToStitch = uploadChunksViaRouter(creationTimeMs, REF_CONTAINER, chunkSizes);
List<String> signedChunkIds = chunksToStitch.stream()
.map(chunkInfo -> prefix + getSignedId(chunkInfo, uploadSession))
.collect(Collectors.toList());
stitchBlobAndVerify(getStitchRequestBody(signedChunkIds), chunksToStitch, null);

if (chunksToStitch.size() == 262144) {
return;
}
// one chunk
chunksToStitch = uploadChunksViaRouter(creationTimeMs, REF_CONTAINER, 45);
signedChunkIds = chunksToStitch.stream()
Expand Down