Support OSD Latency for Nautilus release

This commit is contained in:
greatbn 2019-09-12 21:17:51 +09:00
parent 1df560f980
commit 1f2df8db38
2 changed files with 44 additions and 38 deletions

View File

@ -385,6 +385,10 @@ type cephPerfStat struct {
} `json:"osd_perf_infos"`
}
type cephOSDPerfStat struct {
cephPerfStat `json:"osdstats"`
}
type cephOSDDump struct {
OSDs []struct {
OSD json.Number `json:"osd"`
@ -534,7 +538,7 @@ func (o *OSDCollector) collectOSDPerf() error {
return err
}
osdPerf := &cephPerfStat{}
osdPerf := &CephOSDPerfStat{}
if err := json.Unmarshal(buf, osdPerf); err != nil {
return err
}

View File

@ -161,6 +161,7 @@ func TestOSDCollector(t *testing.T) {
{
input: `
{
"osdstats": {
"osd_perf_infos": [
{
"id": 4,
@ -198,6 +199,7 @@ func TestOSDCollector(t *testing.T) {
}
}
]
}
}`,
regexes: []*regexp.Regexp{
regexp.MustCompile(`ceph_osd_perf_commit_latency_seconds{cluster="ceph",osd="osd.0"} 0.002`),