Skip to content

compress: count uncompressed input bytes#13287

Open
moonchen wants to merge 1 commit into
apache:masterfrom
moonchen:compress-bytes-in-metric
Open

compress: count uncompressed input bytes#13287
moonchen wants to merge 1 commit into
apache:masterfrom
moonchen:compress-bytes-in-metric

Conversation

@moonchen

Copy link
Copy Markdown
Contributor

Add proxy.process.plugin.compress.bytes_in to track the volume of data the
compress plugin processes.

Copilot AI review requested due to automatic review settings June 16, 2026 23:16
@moonchen moonchen self-assigned this Jun 16, 2026
@moonchen moonchen added this to the 11.0.0 milestone Jun 16, 2026
@moonchen moonchen added Plugins compress compress plugin labels Jun 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new runtime metric to the compress plugin to track how many input (pre-compression) bytes the plugin processes, enabling operational visibility into compression workload.

Changes:

  • Introduces a new stat proxy.process.plugin.compress.bytes_in.
  • Initializes the stat during both global plugin init (TSPluginInit) and remap plugin init (TSRemapInit).
  • Increments the stat in the transform path based on bytes consumed from the upstream reader.

Comment thread plugins/compress/compress.cc
@moonchen

Copy link
Copy Markdown
Contributor Author

[approve ci autest]

Add proxy.process.plugin.compress.bytes_in to track the volume of data the
compress plugin processes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@moonchen moonchen force-pushed the compress-bytes-in-metric branch from d2dfccb to e236367 Compare June 18, 2026 20:48
{
if (TS_ERROR == compress_stat_bytes_in) {
compress_stat_bytes_in =
TSStatCreate("proxy.process.plugin.compress.bytes_in", TS_RECORDDATATYPE_COUNTER, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be updated to the new metrics API, since TSStatCreate is deprecated for 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants