docs: improve stdout-log-generator README with full argument documentation - #3763
docs: improve stdout-log-generator README with full argument documentation#3763k15r wants to merge 1 commit into
Conversation
Control PanelHi, I'm an AI-powered Review Bot that helps you with summarizing and reviewing pull requests.
|
SummaryThe following content is AI-generated and provides a summary of the pull request: What ChangedRewrites the Key Changes
Notes for ReviewersThis is a documentation-only change. Verify that the flag names, short forms, defaults, and descriptions in the table match the current Release Notes InputNone.
PR Bot InformationVersion:
|
| A small tool that continuously writes log lines to stdout. Used in the e2e tests of telemetry-manager to produce configurable log traffic inside Kubernetes workloads. | ||
|
|
||
| Available command line args: | ||
| The tool exposes a Prometheus metrics endpoint on port `2112` (`/metrics`) with two metrics: |
There was a problem hiding this comment.
| The tool exposes a Prometheus metrics endpoint on port `2112` (`/metrics`) with two metrics: | |
| The tool exposes a Prometheus metrics endpoint on port `2112` (`/metrics`) with the following metrics: |
never mention the exact number when introducing a list, easier for maintenancce
| # Stdout Log Generator | ||
|
|
||
| Small tool for generating logs to stdout, used in the e2e tests of the telemetry-manager. | ||
| A small tool that continuously writes log lines to stdout. Used in the e2e tests of telemetry-manager to produce configurable log traffic inside Kubernetes workloads. |
There was a problem hiding this comment.
| A small tool that continuously writes log lines to stdout. Used in the e2e tests of telemetry-manager to produce configurable log traffic inside Kubernetes workloads. | |
| `stdout-log-generator` is a tool that continuously writes log lines to stdout. Telemetry Manager e2e tests use it to generate configurable log traffic inside Kubernetes workloads. |
| | `--format` | | `json` | Output format: `json` or `plaintext` | | ||
| | `--bytes` | `-b` | `2048` | Size of each log line in bytes | | ||
| | `--rate` | `-r` | `1` | Target log lines per second. `0` means unlimited | | ||
| | `--fields` | `-f` | | Additional key=value fields to include in every JSON log record (can be repeated or comma-separated). Ignored when `--format plaintext` is used | |
There was a problem hiding this comment.
less ambiguity
| | `--fields` | `-f` | | Additional key=value fields to include in every JSON log record (can be repeated or comma-separated). Ignored when `--format plaintext` is used | | |
| | `--fields` | `-f` | | Additional key=value fields to include in every JSON log record. You can specify it multiple times or provide a comma-separated list. Ignored when `--format plaintext` is used | |
| | `--bytes` | `-b` | `2048` | Size of each log line in bytes | | ||
| | `--rate` | `-r` | `1` | Target log lines per second. `0` means unlimited | | ||
| | `--fields` | `-f` | | Additional key=value fields to include in every JSON log record (can be repeated or comma-separated). Ignored when `--format plaintext` is used | | ||
| | `--text` | `-t` | | Fixed text to write for every plaintext log line. Ignored if `--bytes` is set. Only relevant when `--format plaintext` is used | |
There was a problem hiding this comment.
| | `--text` | `-t` | | Fixed text to write for every plaintext log line. Ignored if `--bytes` is set. Only relevant when `--format plaintext` is used | | |
| | `--text` | `-t` | | Fixed text to write for every plaintext log line. Applies only if you use `--format plaintext`. Ignored if you set `--bytes`. | |
|
|
||
| ### Plaintext | ||
|
|
||
| Each line is either the fixed string given by `--text`, or a random string of `--bytes` length when `--text` is not set. |
There was a problem hiding this comment.
| Each line is either the fixed string given by `--text`, or a random string of `--bytes` length when `--text` is not set. | |
| The content of each line depends on whether you set the `--bytes` flag: | |
| - With `--bytes`, each line is a random string of the specified length. | |
| - Without `--bytes` but with `--text`, each line is the fixed string you provide. |
| ### Plaintext | ||
|
|
||
| Each line is either the fixed string given by `--text`, or a random string of `--bytes` length when `--text` is not set. | ||
|
|
There was a problem hiding this comment.
what if neither flag (--bytes or --text) is set? Random string with default byte size of 2048.
|
|
||
| ## Rate limiting | ||
|
|
||
| The tool uses a token-bucket rate limiter (`golang.org/x/time/rate`). On Linux, the minimum achievable sleep granularity is approximately 2 ms. To compensate, the burst size is set to `2 × (rate / 1000)` so that the generator can emit multiple logs back-to-back before sleeping, keeping the long-run average close to the requested rate even at high throughputs. |
There was a problem hiding this comment.
Splitting the sentence for clarity
| The tool uses a token-bucket rate limiter (`golang.org/x/time/rate`). On Linux, the minimum achievable sleep granularity is approximately 2 ms. To compensate, the burst size is set to `2 × (rate / 1000)` so that the generator can emit multiple logs back-to-back before sleeping, keeping the long-run average close to the requested rate even at high throughputs. | |
| The tool uses a token-bucket rate limiter (`golang.org/x/time/rate`). On Linux, the minimum achievable sleep granularity is approximately 2 ms. To compensate for this, the burst size is set to `2 × (rate / 1000)`. This setting lets the generator emit multiple logs back-to-back before sleeping, keeping the long-run average close to the requested rate even at high throughput. |
|
|
||
| The tool uses a token-bucket rate limiter (`golang.org/x/time/rate`). On Linux, the minimum achievable sleep granularity is approximately 2 ms. To compensate, the burst size is set to `2 × (rate / 1000)` so that the generator can emit multiple logs back-to-back before sleeping, keeping the long-run average close to the requested rate even at high throughputs. | ||
|
|
||
| Setting `--rate 0` disables throttling entirely (write as fast as possible). |
There was a problem hiding this comment.
purpose first, then instruction
| Setting `--rate 0` disables throttling entirely (write as fast as possible). | |
| To disable throttling and write logs as fast as possible, set `--rate 0`. |
|
|
||
| ### JSON (default) | ||
|
|
||
| Each line is a JSON object with a `padding` field filled with random characters to reach the requested byte size, plus any custom fields added via `--fields`: |
There was a problem hiding this comment.
| Each line is a JSON object with a `padding` field filled with random characters to reach the requested byte size, plus any custom fields added via `--fields`: | |
| Each line is a JSON object with a `padding` field filled with random characters to reach the requested byte size, plus any custom fields added with `--fields`: |
Summary
docker runexample alongside the existing build instructionsTest plan
main.godefinitions