Fix InfluxDB storage total() method pagination

Change-Id: I135e0a5ba02ee84dd057ab0fa7c2a2c6f47f2e7b
This commit is contained in:
Luka Peschke 2019-02-13 18:11:57 +01:00
parent be38ba70f9
commit 087038e8e9
2 changed files with 2 additions and 2 deletions

View File

@ -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,
}

View File

@ -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)