-
Notifications
You must be signed in to change notification settings - Fork 267
M365 Crawler Metric, Buffer, and Unit Test Updates #6142
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
base: main
Are you sure you want to change the base?
Conversation
new ParameterizedTypeReference<>() {} | ||
); | ||
// Record search request size. | ||
searchRequestSizeSummary.record(response.getHeaders().getContentLength()); |
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.
Why are we recording the response header length for the search request size?
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't naming these RequestSize
a little misleading? It looks like this is measuring the response size / the size of the audit logs?
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.
Updated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is correct. The "acknowledgementSet.complete();" should be done outside of the loop.
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.
Or create an acknowledgementset inside the loop
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.
Thank you for the feedback. You are correct - I will move the acknowledgementSet.Add(record.getData()) outside of the loop to ensure proper handling of the acknowledgment set. This will prevent potential duplicate events in the acknowledgementSet.
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.
Also, pushed acknowledgementSet.complete() to execute partition logic where all events are being processed.
f740a1b
to
ddc117c
Compare
ddc117c
to
ad597c2
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.