Fix InfluxDB storage total() method pagination
Change-Id: I135e0a5ba02ee84dd057ab0fa7c2a2c6f47f2e7b
This commit is contained in:
parent
be38ba70f9
commit
087038e8e9
@ -365,5 +365,5 @@ class InfluxStorage(v2_storage.BaseStorage):
|
||||
output.sort(key=lambda x: [x[group] for group in groupby])
|
||||
return {
|
||||
'total': len(output),
|
||||
'results': output[offset:limit] if paginate else output,
|
||||
'results': output[offset:offset + limit] if paginate else output,
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ class StorageUnitTest(TestCase):
|
||||
begin=begin,
|
||||
end=end,
|
||||
offset=offset,
|
||||
limit=offset + 2,
|
||||
limit=2,
|
||||
groupby=['type'])
|
||||
# there are seven metric types
|
||||
self.assertEqual(chunk['total'], 7)
|
||||
|
Loading…
Reference in New Issue
Block a user