-
Notifications
You must be signed in to change notification settings - Fork 238
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
Add backoff, retry and other metrics for GCS JSON API #1228
Add backoff, retry and other metrics for GCS JSON API #1228
Conversation
/gcbrun |
/gcbrun |
util/src/main/java/com/google/cloud/hadoop/util/GcsJsonApiEvent.java
Outdated
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/GcsJsonApiEvent.java
Outdated
Show resolved
Hide resolved
gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GhfsGlobalStorageStatistics.java
Show resolved
Hide resolved
gcs/src/test/java/com/google/cloud/hadoop/fs/gcs/GoogleCloudStorageStatisticsTest.java
Show resolved
Hide resolved
gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageStatistics.java
Outdated
Show resolved
Hide resolved
util/src/main/java/com/google/cloud/hadoop/util/GcsJsonApiEvent.java
Outdated
Show resolved
Hide resolved
@@ -196,9 +197,6 @@ public boolean handleResponse(HttpRequest request, HttpResponse response, boolea | |||
} | |||
|
|||
private void logResponseCode(HttpRequest request, HttpResponse response) { | |||
// Incrementing GCS Static Statistics using status code of response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this moved to some other place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this will be done in the event subscriber.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. This is the place from where we are publishing an event in EventBus which will be consumed by subscriber to update metrics. How a subscriber is publishing event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subscriber is incrementing the metric. HttpResonsecod event is not required. That information is present in the event and it will increment the status code.
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Show resolved
Hide resolved
/gcbrun |
Give some warmup time for logging the outliers
/gcbrun |
/gcbrun |
@@ -2424,6 +2422,273 @@ public void testHnBucketDeleteOperationOnNonExistingFolder() throws Exception { | |||
} | |||
} | |||
|
|||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is too big for unit test, can't it be refactored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.
The length is coming from the "expected" results. Refactoring it might make it less readable.
I thought about separating it. But this is having a full lifecycle of an object. i.e create, read, rename and lastly delete. Hence choose to having this as one test.
|
||
@Ignore | ||
@Test | ||
public void testGcsJsonAPIMetrics() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean GcsGrpcAPIMetrics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after gRPC we will have to update this tests. I am not sure if we can get the full parity for gRPC. If not, we might need to have two tests. one for gRPC and another for JSON
util/src/main/java/com/google/cloud/hadoop/util/GcsJsonApiEvent.java
Outdated
Show resolved
Hide resolved
@@ -196,9 +197,6 @@ public boolean handleResponse(HttpRequest request, HttpResponse response, boolea | |||
} | |||
|
|||
private void logResponseCode(HttpRequest request, HttpResponse response) { | |||
// Incrementing GCS Static Statistics using status code of response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. This is the place from where we are publishing an event in EventBus which will be consumed by subscriber to update metrics. How a subscriber is publishing event?
util/src/main/java/com/google/cloud/hadoop/util/interceptors/InvocationIdInterceptor.java
Show resolved
Hide resolved
/gcbrun |
7d92934
into
GoogleCloudDataproc:branch-3.0.x
No description provided.