mirror of
https://github.com/ceph/ceph
synced 2025-01-09 12:42:31 +00:00
50b7d42fe5
This splits out the collection of health and log data from the /api/dashboard/health controller into /api/health/{full,minimal} and /api/logs/all. /health/full contains all the data (minus logs) that /dashboard/health did, whereas /health/minimal contains only what is needed for the health component to function. /logs/all contains exactly what the logs portion of /dashboard/health did. By using /health/minimal, on a vstart cluster we pull ~1.4KB of data every 5s, where we used to pull ~6KB; those numbers would get larger with larger clusters. Once we split out log data, that will drop to ~0.4KB. Fixes: http://tracker.ceph.com/issues/36675 Signed-off-by: Zack Cerza <zack@redhat.com>
39 lines
1023 B
Python
39 lines
1023 B
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import absolute_import
|
|
|
|
from .helper import DashboardTestCase, JList, JObj
|
|
|
|
|
|
class LogsTest(DashboardTestCase):
|
|
CEPHFS = True
|
|
|
|
def test_logs(self):
|
|
data = self._get("/api/logs/all")
|
|
self.assertStatus(200)
|
|
log_entry_schema = JList(JObj({
|
|
'addrs': JObj({
|
|
'addrvec': JList(JObj({
|
|
'addr': str,
|
|
'nonce': int,
|
|
'type': str
|
|
}))
|
|
}),
|
|
'channel': str,
|
|
'message': str,
|
|
'name': str,
|
|
'priority': str,
|
|
'rank': str,
|
|
'seq': int,
|
|
'stamp': str
|
|
}))
|
|
schema = JObj({
|
|
'audit_log': log_entry_schema,
|
|
'clog': log_entry_schema
|
|
})
|
|
self.assertSchema(data, schema)
|
|
|
|
@DashboardTestCase.RunAs('test', 'test', ['pool-manager'])
|
|
def test_log_perms(self):
|
|
self._get("/api/logs/all")
|
|
self.assertStatus(403)
|