File tree Expand file tree Collapse file tree 4 files changed +23
-1
lines changed
Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ struct aws_s3_request_metrics {
7474 int64_t body_read_start_timestamp_ns ;
7575 int64_t body_read_end_timestamp_ns ;
7676 int64_t body_read_duration_ns ;
77+ int64_t body_read_total_without_reset_ns ;
7778 int64_t body_read_total_ns ;
7879 } time_metrics ;
7980
Original file line number Diff line number Diff line change @@ -1474,7 +1474,9 @@ int aws_s3_request_metrics_get_body_read_duration_ns(
14741474int aws_s3_request_metrics_get_body_read_total_ns (
14751475 const struct aws_s3_request_metrics * metrics ,
14761476 int64_t * body_read_total_ns );
1477-
1477+ int aws_s3_request_metrics_get_body_read_total_without_reset_ns (
1478+ const struct aws_s3_request_metrics * metrics ,
1479+ int64_t * body_read_total_without_reset_ns );
14781480/* Get the AWS CRT error code from request metrics. */
14791481AWS_S3_API
14801482int aws_s3_request_metrics_get_error_code (const struct aws_s3_request_metrics * metrics );
Original file line number Diff line number Diff line change @@ -345,6 +345,11 @@ static int s_aws_s3_mmap_part_streaming_input_stream_read(struct aws_input_strea
345345 } else {
346346 impl -> request -> send_data .metrics -> time_metrics .body_read_total_ns += duration ;
347347 }
348+ if (impl -> request -> send_data .metrics -> time_metrics .body_read_total_without_reset_ns == -1 ) {
349+ impl -> request -> send_data .metrics -> time_metrics .body_read_total_without_reset_ns = duration ;
350+ } else {
351+ impl -> request -> send_data .metrics -> time_metrics .body_read_total_without_reset_ns += duration ;
352+ }
348353 aws_s3_meta_request_unlock_synced_data (impl -> meta_request );
349354 /* END CRITICAL SECTION */
350355 if (impl -> in_chunk_offset == impl -> reading_chunk_buf -> len ) {
@@ -457,6 +462,9 @@ struct aws_input_stream *aws_input_stream_new_from_parallel_stream(
457462 impl -> reading_chunk_buf = & impl -> chunk_buf_2 ;
458463 impl -> meta_request = meta_request ;
459464 impl -> request = request ;
465+ if (impl -> request -> send_data .metrics && impl -> request -> send_data .metrics -> time_metrics .body_read_total_ns != -1 ) {
466+ impl -> request -> send_data .metrics -> time_metrics .body_read_total_ns = -1 ;
467+ }
460468
461469 /* Reset the input stream to start */
462470 aws_streaming_input_stream_reset (& impl -> base );
Original file line number Diff line number Diff line change @@ -435,19 +435,30 @@ int aws_s3_request_metrics_get_body_read_start_timestamp_ns(
435435 const struct aws_s3_request_metrics * metrics ,
436436 int64_t * body_read_start_timestamp_ns ) {
437437 * body_read_start_timestamp_ns = metrics -> time_metrics .body_read_start_timestamp_ns ;
438+ return AWS_OP_SUCCESS ;
438439}
439440int aws_s3_request_metrics_get_body_read_end_timestamp_ns (
440441 const struct aws_s3_request_metrics * metrics ,
441442 int64_t * body_read_end_timestamp_ns ) {
442443 * body_read_end_timestamp_ns = metrics -> time_metrics .body_read_end_timestamp_ns ;
444+ return AWS_OP_SUCCESS ;
443445}
444446int aws_s3_request_metrics_get_body_read_duration_ns (
445447 const struct aws_s3_request_metrics * metrics ,
446448 int64_t * body_read_duration_ns ) {
447449 * body_read_duration_ns = metrics -> time_metrics .body_read_duration_ns ;
450+ return AWS_OP_SUCCESS ;
448451}
449452int aws_s3_request_metrics_get_body_read_total_ns (
450453 const struct aws_s3_request_metrics * metrics ,
451454 int64_t * body_read_total_ns ) {
452455 * body_read_total_ns = metrics -> time_metrics .body_read_total_ns ;
456+ return AWS_OP_SUCCESS ;
457+ }
458+
459+ int aws_s3_request_metrics_get_body_read_total_without_reset_ns (
460+ const struct aws_s3_request_metrics * metrics ,
461+ int64_t * body_read_total_without_reset_ns ) {
462+ * body_read_total_without_reset_ns = metrics -> time_metrics .body_read_total_without_reset_ns ;
463+ return AWS_OP_SUCCESS ;
453464}
You can’t perform that action at this time.
0 commit comments