-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add statistics for CRUD operations on router #244
Add statistics for CRUD operations on router #244
Conversation
2c3c332
to
04e57b7
Compare
04e57b7
to
096c41f
Compare
6e1306c
to
a734377
Compare
0504ed8
to
0b43ec6
Compare
metrics integrations leads to timeouts in perf test: https://github.com/tarantool/crud/runs/4442731842?check_suite_focus=true |
0b43ec6
to
a7324e8
Compare
5a6e025
to
dad3d17
Compare
I tuned out summary parameters to not cause timeouts (on local runs). But performance drop is still noticeable (2-3 times). I have discussed the issue with @yngvar-antonsson and filed a ticket (tarantool/metrics#331). CI perf test not runs with |
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
Since we have PR #244 it will be nice to collect statistics for batch operations too. To establish the effectiveness of `crud.batch_insert()` method compared to `crud.insert()`, perf tests were added. `crud.insert()` in the loop and `crud.batch_insert()` are compared for different batch sizes. Closes #193
`crud` module is cartridge-independent in nature, but provides cartridge roles which are the most popular way to setup the module. The roles also not use any modern cartridge features and should work with any cartridge version. But since crud.cfg was introduced [1], it was required to add some code for roles reload [2] proper support. Now cartridge.hotreload module is unconditionally required, so roles cannot be used with cartridge older than 2.4.0. This patch fixes the behavior. 1. 6da4f56 2. tarantool/cartridge@941952e Follows #244
Before this patch, tests were marked with xfail since there was a bug in metrics module [1]. This bug is fixes in newer versions, so xfail is replaced with skip based on metrics version. 1. tarantool/metrics#334 Follows #244
Before this patch, tests were marked with xfail since there was a bug in metrics module [1]. This bug is fixes in newer versions, so xfail is replaced with skip based on metrics version. 1. tarantool/metrics#334 Follows #244
`crud` module is cartridge-independent in nature, but provides cartridge roles which are the most popular way to setup the module. The roles also not use any modern cartridge features and should work with any cartridge version. But since crud.cfg was introduced [1], it was required to add some code for roles reload [2] proper support. Now cartridge.hotreload module is unconditionally required, so roles cannot be used with cartridge older than 2.4.0. This patch fixes the behavior. 1. 6da4f56 2. tarantool/cartridge@941952e Follows #244
Before this patch, tests were marked with xfail since there was a bug in metrics module [1]. This bug is fixes in newer versions, so xfail is replaced with skip based on metrics version. 1. tarantool/metrics#334 Follows #244
`crud` module is cartridge-independent in nature, but provides cartridge roles which are the most popular way to setup the module. The roles also not use any modern cartridge features and should work with any cartridge version. But since crud.cfg was introduced [1], it was required to add some code for roles reload [2] proper support. Now cartridge.hotreload module is unconditionally required, so roles cannot be used with cartridge older than 2.4.0. This patch fixes the behavior. 1. 6da4f56 2. tarantool/cartridge@941952e Follows #244
Before this patch, tests were marked with xfail since there was a bug in metrics module [1]. This bug is fixes in newer versions, so xfail is replaced with skip based on metrics version. 1. tarantool/metrics#334 Follows #244
Add statistics module for collecting metrics of CRUD operations on
router. Wrap all CRUD operation calls in the statistics collector.
Statistics must be enabled manually with
crud.cfg
. They can bedisabled, restarted or re-enabled later.
crud.stats()
returnsspaces
section contains statistics for each observed space.If operation has never been called for a space, the corresponding
field will be empty. If no requests has been called for a
space, it will not be represented. Space data is based on
client requests rather than storages schema, so requests
for non-existing spaces are also collected.
This patch introduces
crud.cfg
.crud.cfg
is a tool to set moduleconfiguration. It is similar to Tarantool
box.cfg
, although we don'tneed to call it to bootstrap the module -- it is used only to change
configuration.
crud.cfg
is a callable table. To change configuration,call it:
crud.cfg{ stats = true }
. You can check table contents aswith ordinary table, but do not change them directly -- use call
instead. Table contents is immutable and use proxy approach
(see [1, 2]). Iterating through
crud.cfg
with pairs is not supportedyet, refer to #265.
Possible statistics operation labels are
insert
(forinsert
andinsert_object
calls),get
,replace
(forreplace
andreplace_object
calls),update
,upsert
(forupsert
andupsert_object
calls),delete
,select
(forselect
andpairs
calls),truncate
,len
,count
and
borders
(formin
andmax
calls).Each operation section consists of different collectors
for success calls and error (both error throw and
nil, err
)returns.
count
is total requests count since instance startor stats restart.
latency
is average time of requests execution,time
is the total time of requests execution.Since
pairs
request behavior differs from any other crud request, itsstatistics collection also has specific behavior. Statistics (
select
section) are updated after
pairs
cycle is finished: youeither have iterated through all records or an error was thrown.
If your pairs cycle was interrupted with
break
, statistics willbe collected when pairs objects are cleaned up with Lua garbage
collector.
Statistics are preserved between package reloads. Statistics are
preserved between Tarantool Cartridge role reloads [3] if CRUD Cartridge
roles are used.
Statistics
select
section additionally containsdetails
collectors.map_reduces
is the count of planned map reduces (including those notexecuted successfully).
tuples_fetched
is the count of tuples fetchedfrom storages during execution,
tuples_lookup
is the count of tupleslooked up on storages while collecting responses for calls (including
scrolls for multibatch requests). Details data is updated as part of
the request process, so you may get new details before
select
/pairs
call is finished and observed with count, latency and time collectors. q
Use in-built
crud.stats()
info instead onstorage_stat
helperin tests to track map reduce calls.
If
metrics
[4] found, you can use metrics collectors to storestatistics.
metrics >= 0.10.0
is required to use metrics driver.(
metrics >= 0.9.0
is required to use summary quantiles withage buckets.
metrics >= 0.5.0, < 0.9.0
is unsupporteddue to quantile overflow bug [5].
metrics == 0.9.0
has bug that donot permits to create summary collector without quantiles [6].
In fact, user may use
metrics >= 0.5.0
,metrics != 0.9.0
if he wants to use metrics without quantiles, and
metrics >= 0.9.0
if he wants to use metrics with quantiles. But this is confusing,
so let's use a single restriction for both cases.)
The metrics are part of global registry and can be exported together
(e.g. to Prometheus) with default tools without any additional
configuration. Disabling stats destroys the collectors.
Metrics collectors are used by default if supported. To explicitly set
driver, call
crud.cfg{ stats = true, stats_driver = driver }
('local' or 'metrics'). To enable quantiles, call
With quantiles,
latency
statistics are changed to 0.99 quantileof request execution time (with aging). Quantiles computations increases
performance overhead up to 10% when used in statistics.
Add CI matrix to run tests with
metrics
installed. To get fullcoverage on coveralls, #248 must be resolved.
The metrics are part of global registry and can be exported together
(e.g. to Prometheus) with default tools without any additional
configuration. Disabling stats destroys the collectors.
Metrics collectors are used by default if supported. To explicitly set
driver, call
crud.enable_stats{ driver = driver }
('local' or'metrics'). To enable quantiles, call
crud.enable_stats{ driver = 'metrics', quantiles = true }
.With quantiles,
latency
statistics are changed to 0.99 quantileof request execution time (with aging). Quantiles computations increases
performance overhead up to 10% when used in statistics.
Add CI matrix to run tests with
metrics
installed. To get fullcoverage on coveralls, #248 must be resolved.
Metrics collectors are used by default if supported. To explicitly set
driver, call
crud.enable_stats{ driver = driver }
('local' or'metrics').
If
metrics
used,latency
statistics are changed to 0.99 quantileof request execution time (with aging).
Add CI matrix to run tests with
metrics
installed. To get fullcoverage on coveralls, #248 must be resolved.
Before this patch, performance tests ran together with unit and
integration with
--coverage
flag. Coverage analysis cropped theresult of performance tests to 10-15 times. For metrics integration
it resulted in timeout errors and drop of performance which is not
reproduces with coverage disabled. Moreover, before this patch log
capture was disabled and performance tests did not displayed any
results after run. Now performance tests also run is separate CI job.
After this patch,
make -C build coverage
will run lightweightversion of performance test.
make -C build performance
will run realperformance tests.
You can paste output table to GitHub [7].
This path also reworks current performance test. It adds new cases to
compare module performance with or without statistics, statistic
wrappers and compare different metrics drivers and reports new info:
average call time and max call time.
Performance test result: overhead is 3-10% in case of
local
driver and5-15% in case of
metrics
driver, up to 20% formetrics
withquantiles. Based on several runs on HP ProBook 440 G7 i7/16Gb/256SSD.
Success requests per second
Max call time
Performance overhead is 3-10% in case of
local
driver and5-15% in case of
metrics
driver, up to 20% formetrics
with quantiles.I didn't forget about
Closes #224, closes #233