[ovs-dev] [PATCH v4 0/2] Add Performance Measurement Library
Jakub Sitnicki
jkbs at redhat.com
Wed Feb 28 14:17:12 UTC 2018
On Tue, 20 Feb 2018 16:13:30 -0600
Mark Michelson <mmichels at redhat.com> wrote:
> This set of commits adds a new library for OVS that allows for measuring
> the performance of operations in OVS and compiling statistics from these
> measurements.
>
> For developers, this can provide a measurement of something that is
> either finer or coarser-grained than what is easily measured with a
> profiler.
At the risk of sounding like a broken record - I think we do need tests for this
new module. Otherwise verifying the calculations is difficult.
So here are patches that add tests. Feel free to incorporate them into the
series, reuse the code, or use it just for development.
Some problems that I've noticed while reviewing/testing it:
1. Return status from start_sample/end_sample is always true, so it's not very
useful. It has also led me to thinking that the sample has been processed
correctly, so you might even say that it is confusing.
2. Minimum value is not getting initialized, so it is always 0. See FIXME's in
the tests.
3. The calculation of 95th percentile seems to be quite off for a simple
population of 10 samples ({ 1, 2, ..., 10 }). I'm not familiar with the P^2
method that was used so maybe it's expected. Worth checking. There is a FIXME
in the tests.
4. It is not possible to use 0 as an initial timestamp. Seems like a weird
limitation.
5. The module calculates statistics over durations of time intervals. Is the
name 'performance' adequate for something as specific?
Thanks,
Jakub
---
Jakub Sitnicki (3):
performance: Add API for retrieving calculated statistics
performance: Add API for waiting until samples have been processed
tests: Add tests for performance library module
lib/performance.c | 52 ++++++++++++++++
lib/performance.h | 16 +++++
tests/automake.mk | 3 +-
tests/library.at | 5 ++
tests/test-performance.c | 150 +++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 225 insertions(+), 1 deletion(-)
create mode 100644 tests/test-performance.c
--
2.14.3
More information about the dev
mailing list