Skip to content

Commit 9c32313

Browse files
author
Krish
committed
changed amz_id_2 to extended_request_id
1 parent 4171d93 commit 9c32313

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

include/aws/s3/private/s3_request.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ struct aws_s3_request_metrics {
146146
/* The the request ID header value. */
147147
struct aws_string *request_id;
148148
/* The the extended request ID header value. */
149-
struct aws_string *amz_id_2;
149+
struct aws_string *extended_request_id;
150150
/* S3 operation name for the request */
151151
struct aws_string *operation_name;
152152
/* The type of request made */
@@ -303,7 +303,7 @@ struct aws_s3_request {
303303

304304
/* Returned request ID of this request. */
305305
struct aws_string *request_id;
306-
/* Returned amz ID 2 of this request. */
306+
/* Returned extended request id of this request. */
307307
struct aws_string *amz_id_2;
308308

309309
/* The metrics for the request telemetry */

include/aws/s3/s3_client.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,13 +1393,13 @@ int aws_s3_request_metrics_get_request_id(
13931393
/**
13941394
* Get the extended request ID from aws_s3_request_metrics.
13951395
* If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.
1396-
* If available, out_amz_id_2 will be set to a string. Be warned this string's lifetime is tied to the metrics
1397-
* object.
1396+
* If available, out_extended_request_id will be set to a string. Be warned this string's lifetime is tied to the
1397+
* metrics object.
13981398
**/
13991399
AWS_S3_API
1400-
int aws_s3_request_metrics_get_amz_id_2(
1400+
int aws_s3_request_metrics_get_extended_request_id(
14011401
const struct aws_s3_request_metrics *metrics,
1402-
const struct aws_string **out_amz_id_2);
1402+
const struct aws_string **out_extended_request_id);
14031403

14041404
/* Get the start time from aws_s3_request_metrics, which is when S3 client prepare the request to be sent. Always
14051405
* available. Timestamp are from `aws_high_res_clock_get_ticks` */
@@ -1574,10 +1574,10 @@ int aws_s3_request_metrics_get_ip_address(
15741574
const struct aws_s3_request_metrics *metrics,
15751575
const struct aws_string **out_ip_address);
15761576

1577-
/* Get the id of connection that request was made from. AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised if data
1578-
* not available */
1577+
/* Get the ptr address of connection that request was made from. AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised
1578+
* if data not available */
15791579
AWS_S3_API
1580-
int aws_s3_request_metrics_get_connection_ptr(const struct aws_s3_request_metrics *metrics, size_t *out_connection_ptr);
1580+
int aws_s3_request_metrics_get_connection_id(const struct aws_s3_request_metrics *metrics, size_t *out_connection_ptr);
15811581

15821582
/* Get the pointer to the request that attempt was made from. Always available. */
15831583
AWS_S3_API

source/s3_meta_request.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ static int s_s3_meta_request_incoming_headers(
13811381
if (request->send_data.amz_id_2 == NULL && aws_byte_cursor_eq(name, &g_amz_id_2_header_name)) {
13821382
request->send_data.amz_id_2 = aws_string_new_from_cursor(connection->request->allocator, value);
13831383
if (collect_metrics) {
1384-
request->send_data.metrics->req_resp_info_metrics.amz_id_2 =
1384+
request->send_data.metrics->req_resp_info_metrics.extended_request_id =
13851385
aws_string_new_from_cursor(connection->request->allocator, value);
13861386
}
13871387
}

source/s3_request.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static void s_s3_request_metrics_destroy(void *arg) {
225225
aws_string_destroy(metrics->req_resp_info_metrics.request_path_query);
226226
aws_string_destroy(metrics->req_resp_info_metrics.host_address);
227227
aws_string_destroy(metrics->req_resp_info_metrics.request_id);
228-
aws_string_destroy(metrics->req_resp_info_metrics.amz_id_2);
228+
aws_string_destroy(metrics->req_resp_info_metrics.extended_request_id);
229229
aws_string_destroy(metrics->req_resp_info_metrics.operation_name);
230230
aws_string_destroy(metrics->crt_info_metrics.ip_address);
231231

@@ -309,15 +309,15 @@ int aws_s3_request_metrics_get_request_id(
309309
return AWS_OP_SUCCESS;
310310
}
311311

312-
int aws_s3_request_metrics_get_amz_id_2(
312+
int aws_s3_request_metrics_get_extended_request_id(
313313
const struct aws_s3_request_metrics *metrics,
314-
const struct aws_string **out_amz_id_2) {
314+
const struct aws_string **out_extended_request_id) {
315315
AWS_PRECONDITION(metrics);
316-
AWS_PRECONDITION(out_amz_id_2);
317-
if (metrics->req_resp_info_metrics.amz_id_2 == NULL) {
316+
AWS_PRECONDITION(out_extended_request_id);
317+
if (metrics->req_resp_info_metrics.extended_request_id == NULL) {
318318
return aws_raise_error(AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE);
319319
}
320-
*out_amz_id_2 = metrics->req_resp_info_metrics.amz_id_2;
320+
*out_extended_request_id = metrics->req_resp_info_metrics.extended_request_id;
321321
return AWS_OP_SUCCESS;
322322
}
323323

@@ -573,7 +573,7 @@ int aws_s3_request_metrics_get_ip_address(
573573
return AWS_OP_SUCCESS;
574574
}
575575

576-
int aws_s3_request_metrics_get_connection_ptr(const struct aws_s3_request_metrics *metrics, size_t *connection_ptr) {
576+
int aws_s3_request_metrics_get_connection_id(const struct aws_s3_request_metrics *metrics, size_t *connection_ptr) {
577577
AWS_PRECONDITION(metrics);
578578
AWS_PRECONDITION(connection_ptr);
579579
if (metrics->crt_info_metrics.connection_ptr == NULL) {

tests/s3_mock_server_tests.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "aws/s3/private/s3_util.h"
77
#include "aws/s3/s3_client.h"
88
#include "s3_tester.h"
9-
#include <aws/common/hash_table.h>
109
#include <aws/io/stream.h>
1110
#include <aws/io/uri.h>
1211
#include <aws/testing/aws_test_harness.h>
@@ -140,7 +139,7 @@ static int s_validate_create_multipart_upload_metrics(struct aws_s3_request_metr
140139
aws_thread_id_t thread_id = 0;
141140
ASSERT_SUCCESS(aws_s3_request_metrics_get_thread_id(metrics, &thread_id));
142141
size_t connection_ptr = 0;
143-
ASSERT_SUCCESS(aws_s3_request_metrics_get_connection_ptr(metrics, &connection_ptr));
142+
ASSERT_SUCCESS(aws_s3_request_metrics_get_connection_id(metrics, &connection_ptr));
144143
ASSERT_UINT_EQUALS(AWS_ERROR_SUCCESS, aws_s3_request_metrics_get_error_code(metrics));
145144

146145
/* Get all those time stamp */
@@ -262,6 +261,7 @@ static int s_validate_retry_metrics(struct aws_array_list *metrics_list, uint32_
262261
metrics->time_metrics.s3_request_first_attempt_start_timestamp_ns,
263262
metrics2->time_metrics.s3_request_first_attempt_start_timestamp_ns);
264263
ASSERT_INT_EQUALS(metrics->crt_info_metrics.retry_attempt + 1, metrics2->crt_info_metrics.retry_attempt);
264+
ASSERT_TRUE(metrics->crt_info_metrics.request_ptr == metrics2->crt_info_metrics.request_ptr);
265265
metrics = metrics2;
266266
}
267267
ASSERT_SUCCESS(s_validate_upload_part_metrics(metrics, true));
@@ -473,7 +473,6 @@ TEST_CASE(multipart_upload_failure_with_mock_server) {
473473

474474
struct aws_byte_cursor object_path = aws_byte_cursor_from_c_str("/default");
475475
{
476-
/* 1. Trailer checksum */
477476
struct aws_s3_tester_meta_request_options put_options = {
478477
.allocator = allocator,
479478
.meta_request_type = AWS_S3_META_REQUEST_TYPE_PUT_OBJECT,

0 commit comments

Comments
 (0)