mirror of
https://github.com/digitalocean/ceph_exporter
synced 2025-02-20 05:16:49 +00:00
Support OSD Latency for Nautilus release
This commit is contained in:
parent
1df560f980
commit
1f2df8db38
@ -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
|
||||
}
|
||||
|
@ -161,43 +161,45 @@ func TestOSDCollector(t *testing.T) {
|
||||
{
|
||||
input: `
|
||||
{
|
||||
"osd_perf_infos": [
|
||||
{
|
||||
"id": 4,
|
||||
"perf_stats": {
|
||||
"commit_latency_ms": 0,
|
||||
"apply_latency_ms": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"perf_stats": {
|
||||
"commit_latency_ms": 1,
|
||||
"apply_latency_ms": 64
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"perf_stats": {
|
||||
"commit_latency_ms": 2,
|
||||
"apply_latency_ms": 79
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"perf_stats": {
|
||||
"commit_latency_ms": 2,
|
||||
"apply_latency_ms": 39
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 0,
|
||||
"perf_stats": {
|
||||
"commit_latency_ms": 2,
|
||||
"apply_latency_ms": 31
|
||||
}
|
||||
}
|
||||
]
|
||||
"osdstats": {
|
||||
"osd_perf_infos": [
|
||||
{
|
||||
"id": 4,
|
||||
"perf_stats": {
|
||||
"commit_latency_ms": 0,
|
||||
"apply_latency_ms": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"perf_stats": {
|
||||
"commit_latency_ms": 1,
|
||||
"apply_latency_ms": 64
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"perf_stats": {
|
||||
"commit_latency_ms": 2,
|
||||
"apply_latency_ms": 79
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"perf_stats": {
|
||||
"commit_latency_ms": 2,
|
||||
"apply_latency_ms": 39
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 0,
|
||||
"perf_stats": {
|
||||
"commit_latency_ms": 2,
|
||||
"apply_latency_ms": 31
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}`,
|
||||
regexes: []*regexp.Regexp{
|
||||
regexp.MustCompile(`ceph_osd_perf_commit_latency_seconds{cluster="ceph",osd="osd.0"} 0.002`),
|
||||
|
Loading…
Reference in New Issue
Block a user