Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meter rates: docs state units/second, while code uses units/microsecond #74

Open
Trigary opened this issue Jun 22, 2024 · 0 comments
Open

Comments

@Trigary
Copy link
Contributor

Trigary commented Jun 22, 2024

The Thrift API's meter_array_set_rates, meter_set_rates, and meter_get_rates methods all state (in their documentation) that the meter rates are specified in units/second (where units is bytes or packets). But the actual implementations work with units/microsecond.

For example, meter_array_set_rates passes the specified rate value to the BmMeterRateConfig class, which specifies that it works with units_per_micros.

I do not know whether this bug also exists in the P4Runtime API.

In my opinion, a public API dealing with units/second is preferred, and the implementation should be responsible for converting the rates to/from units/microsecond. But fixing this bug by changing the implementation would be a breaking change, potentially breaking existing code that depends on this library. Changing the documentation would also fix this issue and it would not be a breaking change, but I believe the end result would be less favorable.

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

No branches or pull requests

1 participant