Skip to content

add postage - #2

Open
bit-aloo wants to merge 1 commit into
mainfrom
2026-01-27-add-postage
Open

add postage #2
bit-aloo wants to merge 1 commit into
mainfrom
2026-01-27-add-postage

Conversation

@bit-aloo

Copy link
Copy Markdown
Owner

No description provided.

@bit-aloo
bit-aloo force-pushed the 2026-01-27-add-postage branch from 338b1a8 to 562adc6 Compare January 27, 2026 05:30
bit-aloo pushed a commit that referenced this pull request Apr 29, 2026
…st assertions

Replaces string-concatenation form ("name{k=\"v\"}") with a structured
Metric<'a> { name, labels } type. Bare-name callers stay unchanged via
From<&str>; labeled callers use Metric::with_labels(name, &[(k, v), ...]).

Benefits over the previous string-prefix matching:
- Label matching is order-independent (current code passed by accident
  thanks to the prometheus crate's BTreeMap label ordering)
- Subset matching: query a single label, ignore extras on the line
- Type-safe k/v pairs, no quote escaping at call sites
- Single match path used by parse_metric_value, assert_metric_*,
  assert_metric_present/not_present, and poll_until_metric_gte

Leverages the new API in monitoring_integration tests to assert on the
specific (client_id, channel_id, user_identity) tuple each topology
produces, rather than matching the first series for a metric name.
Catches mis-attributed shares that the bare-name form would silently
accept:
- Test #1 (sv2 mining device): adds an explicit user_id to the fixture
  so the user_identity label is a meaningful 'test-miner' rather than
  empty.
- Test #2 (pool + tProxy + 1 SV1): asserts the SV1 worker name flows
  through to the pool's view of tProxy's channel as
  'user_identity.miner1'.
- Test #3 (aggregated): asserts JDC's 'IT-test' identity on the pool
  side and the SV1 worker name on tProxy's server view.
- Test #4 (block found): unchanged \u2014 sv2_client_blocks_found_total is
  a scalar gauge (no labels), so a bare-name selector is correct here.

Addresses stratum-mining#336 and the related review feedback on stratum-mining#338.
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