Merge "Fix InfluxDB storage total() method pagination"

This commit is contained in:
Zuul 2019-03-07 23:22:12 +00:00 committed by Gerrit Code Review
commit 4225a1553c
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)