M365 Crawler Metric, Buffer, and Unit Test Updates#6142
Conversation
| new ParameterizedTypeReference<>() {} | ||
| ); | ||
| // Record search request size. | ||
| searchRequestSizeSummary.record(response.getHeaders().getContentLength()); |
There was a problem hiding this comment.
Why are we recording the response header length for the search request size?
There was a problem hiding this comment.
This method returns the size of the body in terms of bytes: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/HttpHeaders.html#getContentLength()
I could match the implementation with getAuditLog or vice versa. The main difference here was one is the size of bytes from the string and the other is from responseEntity itself.
5295512 to
c808208
Compare
| private static final String AUDIT_LOG_FETCH_LATENCY = "auditLogFetchLatency"; | ||
| private static final String SEARCH_CALL_LATENCY = "searchCallLatency"; | ||
| private static final String AUDIT_LOGS_REQUESTED = "auditLogsRequested"; | ||
| private static final String AUDIT_LOG_REQUEST_SIZE = "auditLogRequestSizeBytes"; |
There was a problem hiding this comment.
Isn't naming these RequestSize a little misleading? It looks like this is measuring the response size / the size of the audit logs?
| if (configuration.isAcknowledgments()) { | ||
| acknowledgementSet.add(record.getData()); | ||
| buffer.write(record, (int) Duration.ofSeconds(BUFFER_TIMEOUT_IN_SECONDS).toMillis()); | ||
| acknowledgementSet.complete(); |
There was a problem hiding this comment.
I do not think this is correct. The "acknowledgementSet.complete();" should be done outside of the loop.
There was a problem hiding this comment.
Or create an acknowledgementset inside the loop
There was a problem hiding this comment.
Thank you for the feedback. You are correct - I will move the acknowledgementSet.Complete() to avoid premature acknowledgementSet completion.
There was a problem hiding this comment.
Pushed acknowledgementSet.complete() to execute partition logic where all events are being processed.
ddc117c to
ad597c2
Compare
| if (record != null) { | ||
| records.add(record); | ||
| // Write each record individually as it's processed | ||
| writeRecordWithRetry(record, buffer, acknowledgementSet); |
There was a problem hiding this comment.
We should write records for each api instead of writing per event. Writing per event has a bad performance.
There was a problem hiding this comment.
This is per API call for each getAuditLog API call. This is to reduce the potential of buffer throttling for too many events. The AI is to remove batch processing the events.
ad597c2 to
2c00c3d
Compare
san81
left a comment
There was a problem hiding this comment.
Changes look good. Just Make sure to resolve the merge conflicts
047aaa8 to
5c07ead
Compare
50d535c to
2566176
Compare
6a23949 to
48f1213
Compare
Signed-off-by: Alex Christensen <alchrisk@amazon.com>
48f1213 to
3cb5b8b
Compare
Description
This pull request implements comprehensive monitoring enhancements and performance optimizations:
Core Functionality:
Testing and Validation:
The changes have been thoroughly tested and documented, with all tests passing successfully. The implementation follows established coding standards and includes appropriate unit test coverage.
Issues Resolved
N/A
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.