Skip to content

Add --min-self to spanflame top - #4

Merged
Gulliby merged 1 commit into
mainfrom
feature/spanflame-top-min-self
Nov 4, 2026
Merged

Gulliby merged 1 commit into
mainfrom
feature/spanflame-top-min-self

Conversation

@Gulliby

@Gulliby Gulliby commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Requested by gulliby

Before

spanflame top listed every span name, also names with a very small self time.

After

spanflame top --min-self N leaves out a name whose self time is below N microseconds. A name with exactly N stays. N is a whole number from 0 to 1000000000 without a leading zero, like --min-total of tree. The SHARE column still uses the total of all names. --limit counts the names that stay. The value is always in microseconds, whatever --unit says. --min-self belongs to top only. For tree, folded and check it is a usage error (exit 2). Without the option nothing changes.

How

  • src/args.ts, src/cli.ts, src/top.ts: the option, its checks and the filter.
  • tests/top-min-self.test.ts is new. tests/cli.test.ts and tests/docs.test.ts change for the usage text.
  • README.md: the usage block and one example.
  • 200 tests pass (188 before). bun run typecheck and bun run lint are clean.

@Gulliby
Gulliby merged commit 0bf3114 into main Nov 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant