Skip to content
Snippets Groups Projects
Commit eb9066fa authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

vinyl: update gh-2520 test case to the new statistics API

parent 44305191
No related branches found
No related tags found
No related merge requests found
...@@ -697,7 +697,10 @@ s:select() --both upserts are ignored due to primary key change ...@@ -697,7 +697,10 @@ s:select() --both upserts are ignored due to primary key change
-- --
-- gh-2520 use cache as a hint when applying upserts. -- gh-2520 use cache as a hint when applying upserts.
-- --
old_stat = box.info.vinyl().performance["iterator"].run.lookup_count old_stat = box.info.vinyl().performance
---
...
old_disk_lookup_count = s.index.test:info().disk.iterator.lookup
--- ---
... ...
-- insert the first upsert -- insert the first upsert
...@@ -715,16 +718,27 @@ s:get{100} ...@@ -715,16 +718,27 @@ s:get{100}
- [100] - [100]
... ...
-- a lookup in a run was done to populate the cache -- a lookup in a run was done to populate the cache
new_stat = box.info.vinyl().performance["iterator"].run.lookup_count new_stat = box.info.vinyl().performance
--- ---
... ...
new_stat - old_stat new_disk_lookup_count = s.index.test:info().disk.iterator.lookup
--- ---
- 1 ...
upsert_stat_diff(new_stat, old_stat)
---
- squashed: 0
applied: 1
... ...
old_stat = new_stat old_stat = new_stat
--- ---
... ...
new_disk_lookup_count - old_disk_lookup_count
---
- 1
...
old_disk_lookup_count = new_disk_lookup_count
---
...
-- Add another upsert: the cached REPLACE will be used and the upsert will -- Add another upsert: the cached REPLACE will be used and the upsert will
-- be applied immediately -- be applied immediately
s:upsert({100}, {{'=', 2, 300}}) s:upsert({100}, {{'=', 2, 300}})
...@@ -745,16 +759,27 @@ s:get{100} ...@@ -745,16 +759,27 @@ s:get{100}
-- go no further than the latest dump to locate the latest -- go no further than the latest dump to locate the latest
-- value of the key -- value of the key
-- --
new_stat = box.info.vinyl().performance["iterator"].run.lookup_count new_stat = box.info.vinyl().performance
--- ---
... ...
new_stat - old_stat new_disk_lookup_count = s.index.test:info().disk.iterator.lookup
--- ---
- 1 ...
upsert_stat_diff(new_stat, old_stat)
---
- squashed: 0
applied: 0
... ...
old_stat = new_stat old_stat = new_stat
--- ---
... ...
new_disk_lookup_count - old_disk_lookup_count
---
- 1
...
old_disk_lookup_count = new_disk_lookup_count
---
...
s:drop() s:drop()
--- ---
... ...
...@@ -283,7 +283,8 @@ s:select() --both upserts are ignored due to primary key change ...@@ -283,7 +283,8 @@ s:select() --both upserts are ignored due to primary key change
-- --
-- gh-2520 use cache as a hint when applying upserts. -- gh-2520 use cache as a hint when applying upserts.
-- --
old_stat = box.info.vinyl().performance["iterator"].run.lookup_count old_stat = box.info.vinyl().performance
old_disk_lookup_count = s.index.test:info().disk.iterator.lookup
-- insert the first upsert -- insert the first upsert
s:upsert({100}, {{'=', 2, 200}}) s:upsert({100}, {{'=', 2, 200}})
-- force a dump, the inserted upsert is now on disk -- force a dump, the inserted upsert is now on disk
...@@ -291,9 +292,12 @@ box.snapshot() ...@@ -291,9 +292,12 @@ box.snapshot()
-- populate the cache -- populate the cache
s:get{100} s:get{100}
-- a lookup in a run was done to populate the cache -- a lookup in a run was done to populate the cache
new_stat = box.info.vinyl().performance["iterator"].run.lookup_count new_stat = box.info.vinyl().performance
new_stat - old_stat new_disk_lookup_count = s.index.test:info().disk.iterator.lookup
upsert_stat_diff(new_stat, old_stat)
old_stat = new_stat old_stat = new_stat
new_disk_lookup_count - old_disk_lookup_count
old_disk_lookup_count = new_disk_lookup_count
-- Add another upsert: the cached REPLACE will be used and the upsert will -- Add another upsert: the cached REPLACE will be used and the upsert will
-- be applied immediately -- be applied immediately
s:upsert({100}, {{'=', 2, 300}}) s:upsert({100}, {{'=', 2, 300}})
...@@ -306,8 +310,11 @@ s:get{100} ...@@ -306,8 +310,11 @@ s:get{100}
-- go no further than the latest dump to locate the latest -- go no further than the latest dump to locate the latest
-- value of the key -- value of the key
-- --
new_stat = box.info.vinyl().performance["iterator"].run.lookup_count new_stat = box.info.vinyl().performance
new_stat - old_stat new_disk_lookup_count = s.index.test:info().disk.iterator.lookup
upsert_stat_diff(new_stat, old_stat)
old_stat = new_stat old_stat = new_stat
new_disk_lookup_count - old_disk_lookup_count
old_disk_lookup_count = new_disk_lookup_count
s:drop() s:drop()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment