Skip to content

Commit 1ccfa71

Browse files
committed
Log how much time it took to deliver each part to the delivery queue
1 parent aa2d139 commit 1ccfa71

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Release
1111
*.iml
1212
tags
1313

14+
#clangd
15+
.cache
16+
1417
#vim swap file
1518
*.swp
1619

source/s3_auto_ranged_get.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ static void s_s3_auto_ranged_get_request_finished(
947947
}
948948
aws_s3_meta_request_add_event_for_delivery_synced(meta_request, &event);
949949
}
950-
950+
// waahm7: here
951951
aws_s3_meta_request_stream_response_body_synced(meta_request, request);
952952
/* The body of the request is queued to be streamed, don't finish the metrics yet. */
953953
finishing_metrics = false;

source/s3_meta_request.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,11 +2015,14 @@ static void s_s3_meta_request_body_streaming_push_synced(
20152015
aws_priority_queue_push(&meta_request->synced_data.pending_body_streaming_requests, &request);
20162016
}
20172017

2018+
static uint64_t previous_timestamp = 0;
20182019
static struct aws_s3_request *s_s3_meta_request_body_streaming_pop_next_synced(
20192020
struct aws_s3_meta_request *meta_request) {
20202021
AWS_PRECONDITION(meta_request);
20212022
ASSERT_SYNCED_DATA_LOCK_HELD(meta_request);
2022-
2023+
if (previous_timestamp == 0) {
2024+
aws_high_res_clock_get_ticks((uint64_t *)&previous_timestamp);
2025+
}
20232026
if (0 == aws_priority_queue_size(&meta_request->synced_data.pending_body_streaming_requests)) {
20242027
return NULL;
20252028
}
@@ -2035,7 +2038,16 @@ static struct aws_s3_request *s_s3_meta_request_body_streaming_pop_next_synced(
20352038
if ((*top_request)->part_number != meta_request->synced_data.next_streaming_part) {
20362039
return NULL;
20372040
}
2038-
2041+
// waahm7
2042+
uint64_t current_time = 0;
2043+
aws_high_res_clock_get_ticks((uint64_t *)&current_time);
2044+
AWS_LOGF_DEBUG(
2045+
AWS_LS_S3_META_REQUEST,
2046+
"id=%p: waahm7: Time:%llu\tpartNumber:%d",
2047+
(void *)meta_request,
2048+
current_time - previous_timestamp,
2049+
(*top_request)->part_number);
2050+
previous_timestamp = current_time;
20392051
struct aws_s3_request *request = NULL;
20402052
aws_priority_queue_pop(&meta_request->synced_data.pending_body_streaming_requests, (void **)&request);
20412053

0 commit comments

Comments
 (0)