Skip to content

refactor(bvar): Introduce FixedVector as a clearer name - #3777

Open
darion-yaphet wants to merge 2 commits into
apache:masterfrom
darion-yaphet:rename-bvar-vector-to-fixed-vector
Open

darion-yaphet wants to merge 2 commits into
apache:masterfrom
darion-yaphet:rename-bvar-vector-to-fixed-vector

Conversation

@darion-yaphet

Copy link
Copy Markdown
Contributor

Summary

  • Introduce FixedVector as an alias for bvar's fixed-size Vector type and use the clearer name internally.
  • Preserve the original class template, is_vector specializations, and default graph labels for compatibility.
  • Add regression coverage for both names, legacy usage, and series labels.

Risk and Rollback

Vector remains the underlying class template to preserve existing source and binary compatibility. Revert the branch commits to roll back the naming change.

darion-yaphet and others added 2 commits November 26, 2026 00:25
Use FixedVector for the fixed-size co-plotting metric type to avoid
confusion with std::vector. Keep Vector and is_vector as aliases.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Vector as the class template and expose FixedVector as an alias to preserve forward declarations, derived constructors, explicit instantiations, and symbol identity.

Preserve legacy is_vector specializations and default series labels. Add regression coverage for both names and existing client usage.

Co-authored-by: darion-yaphet <darion-yaphet@users.noreply.github.com>

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.

🟢 Approval recommended

No active review issues are reported, and the change includes compatibility-preserving updates with regression coverage for the new alias, traits, behavior, and labels.

No open issues 🎉

What changed in this PR

This pull request introduces bvar::FixedVector as a clearer alias for the existing fixed-size bvar::Vector type while preserving source, binary, trait, and graph-label compatibility.

Changes:

  • Adds the FixedVector alias and is_fixed_vector trait while retaining legacy names and traits.
  • Updates bvar series, latency recorder, and server metrics to use FixedVector internally.
  • Adds regression tests covering compatibility, type behavior, arithmetic, streaming, and graph labels.
File Description
test/​bvar_vector_unittest.cpp Adds regression coverage for both vector names, compatibility traits, behavior, and series labels.
src/​bvar/​vector.h Defines the FixedVector alias and compatibility trait while preserving the original Vector type.
src/​bvar/​variable.cpp Updates the vector-related flag description.
src/​bvar/​passive_status.h Uses the fixed-vector trait when determining additive metric values.
src/​bvar/​latency_recorder.h Uses FixedVector for latency percentile APIs and storage.
src/​bvar/​latency_recorder.cpp Updates latency percentile computation and return types to use FixedVector.
src/​bvar/​detail/​series.h Updates vector-specific series and aggregation specializations to use FixedVector.
src/​brpc/​server.cpp Uses FixedVector for session-local metric values.

Review effort: Lite

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.

2 participants