Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public void log(final TraceMetric traceMetric) {
* {@link #isAllowedToDispatch(PerfMetric)}).
*/
public void log(final TraceMetric traceMetric, final ApplicationProcessState appState) {
checkSessionsList(traceMetric.getPerfSessionsList(), "log(TraceMetric)");
checkSessionsList(traceMetric.getPerfSessionsList(), traceMetric.getName());
executorService.execute(
() -> syncLog(PerfMetric.newBuilder().setTraceMetric(traceMetric), appState));
}
Expand Down Expand Up @@ -330,7 +330,7 @@ public void log(final NetworkRequestMetric networkRequestMetric) {
*/
public void log(
final NetworkRequestMetric networkRequestMetric, final ApplicationProcessState appState) {
checkSessionsList(networkRequestMetric.getPerfSessionsList(), "log(NetworkRequestMetric)");
checkSessionsList(networkRequestMetric.getPerfSessionsList(), networkRequestMetric.getUrl());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The URL from networkRequestMetric.getUrl() can be very long, which might result in excessively long log messages. This could be problematic for logging systems and hard to read. It's a good practice to truncate long strings before logging them.

    String url = networkRequestMetric.getUrl();
    checkSessionsList(
        networkRequestMetric.getPerfSessionsList(),
        url.length() > 128 ? url.substring(0, 128) + "..." : url);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

executorService.execute(
() ->
syncLog(
Expand Down
Loading