Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cache the reflection result when recording metrics #406

Closed
daniel-y opened this issue Oct 20, 2023 · 0 comments · Fixed by #526
Closed

Cache the reflection result when recording metrics #406

daniel-y opened this issue Oct 20, 2023 · 0 comments · Fixed by #526
Assignees
Milestone

Comments

@daniel-y
Copy link
Contributor

private <T> String getResponseStatus(T response) {
        try {
            Method getStatus = response.getClass().getDeclaredMethod("getStatus");
            Status status = (Status) getStatus.invoke(response);
            return status.getCode().name().toLowerCase();
        } catch (Exception e) {
            return "unknown";
        }
    }
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants