Merge "Fix InfluxDB storage total() method pagination"
This commit is contained in:
commit
4225a1553c
|
@ -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