logging: add a marshalled-bytes counter#13277
Open
moonchen wants to merge 1 commit into
Open
Conversation
Adds proxy.process.log.marshalled_bytes, a counter that helps with estimating the cost of logging on an ATS instance.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new process metric to quantify how many bytes ATS marshals for logging, helping operators estimate logging overhead.
Changes:
- Register a new counter metric:
proxy.process.log.marshalled_bytes. - Track marshalled byte volume during
LogObject::log()for log-access entries. - Extend the logging stats block (
LogsStatsBlock) with the new counter pointer.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/proxy/logging/LogObject.cc |
Increments the new marshalled_bytes counter during log entry preparation. |
src/proxy/logging/LogConfig.cc |
Registers the new proxy.process.log.marshalled_bytes counter with the Metrics system. |
include/proxy/logging/LogConfig.h |
Adds marshalled_bytes to LogsStatsBlock so it can be referenced from logging code. |
Comments suppressed due to low confidence (1)
src/proxy/logging/LogObject.cc:645
proxy.process.log.marshalled_bytesis incremented before_checkout_write()succeeds. If the log entry is later dropped because no buffer is available (e.g., entry exceeds buffer payload and the function returnsLog::FAIL), this counter still increases even though nothing was actually marshalled into a log buffer. Move the increment to after the buffer checkout succeeds (and keep it gated onlad) so the counter reflects bytes for successfully-buffered log-access entries.
Metrics::Counter::increment(log_rsb.marshalled_bytes, bytes_needed);
} else if (!text_entry.empty()) {
bytes_needed = INK_ALIGN_DEFAULT(text_entry.size() + 1); // must include null terminator.
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds proxy.process.log.marshalled_bytes, a counter that helps with estimating the cost of logging on an ATS instance.