Skip to content

Commit 82500ee

Browse files
Run performance test for metrics
Before this patch, performance tests ran together with unit and integration with `--coverage` flag. Coverage analysis cropped the result 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. After this patch, `make -C build coverage` will run lightweight version of performance test. `make -C build performance` will run real performance tests. 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. Closes #233, follows up #224
1 parent b98968b commit 82500ee

File tree

4 files changed

+478
-169
lines changed

4 files changed

+478
-169
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,8 @@ crud.enable_stats({ driver = 'metrics', quantiles = true })
619619
-- Use simple local collectors.
620620
crud.enable_stats({ driver = 'local' })
621621
```
622+
Performance overhead is 3-7% in case of `local` driver and
623+
5-15% in case of `metrics` driver, up to 20% for `metrics` with quantiles.
622624

623625
Format is as follows.
624626
```

test/entrypoint/srv_ddl.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ package.preload['customers-storage'] = function()
9090
},
9191
}
9292

93+
local customers_id_schema = table.deepcopy(customers_schema)
94+
customers_id_schema.sharding_key = {'id'}
95+
table.insert(customers_id_schema.indexes, primary_index_id)
96+
table.insert(customers_id_schema.indexes, bucket_id_index)
97+
table.insert(customers_id_schema.indexes, age_index)
98+
9399
local customers_name_key_schema = table.deepcopy(customers_schema)
94100
customers_name_key_schema.sharding_key = {'name'}
95101
table.insert(customers_name_key_schema.indexes, primary_index)
@@ -133,6 +139,7 @@ package.preload['customers-storage'] = function()
133139

134140
local schema = {
135141
spaces = {
142+
customers = customers_id_schema,
136143
customers_name_key = customers_name_key_schema,
137144
customers_name_key_uniq_index = customers_name_key_uniq_index_schema,
138145
customers_name_key_non_uniq_index = customers_name_key_non_uniq_index_schema,
@@ -166,8 +173,8 @@ local ok, err = errors.pcall('CartridgeCfgError', cartridge.cfg, {
166173
'customers-storage',
167174
'cartridge.roles.crud-router',
168175
'cartridge.roles.crud-storage',
169-
},
170-
})
176+
}}, { readahead = 20 * 1024 * 1024 }
177+
)
171178

172179
if not ok then
173180
log.error('%s', err)

0 commit comments

Comments
 (0)