1 Star 0 Fork 0

liucxer / ceph-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
host_client_osd.go 673 Bytes
一键复制 编辑 原始数据 按行查看 历史
liu.changxi@datatom.com 提交于 2021-11-03 11:08 . init
package host_client
import (
"encoding/json"
"github.com/sirupsen/logrus"
)
type OSDPerf struct {
OSD struct {
Numpg int64 `json:"numpg"`
NumpgPrimary int64 `json:"numpg_primary"`
NumpgReplica int64 `json:"numpg_replica"`
NumpgStray int64 `json:"numpg_stray"`
NumpgRemoving int64 `json:"numpg_removing"`
}
}
func (client *HostClient) OSDPerf(osd string) (*OSDPerf, error) {
var res OSDPerf
resp, err := client.ExecCmd("ceph daemon " + osd + " perf dump")
if err != nil {
return nil, err
}
err = json.Unmarshal(resp, &res)
if err != nil {
logrus.Errorf("json.Unmarshal err. [err:%v]", err)
return nil, err
}
return &res, nil
}
1
https://gitee.com/liucxer/ceph-tools.git
git@gitee.com:liucxer/ceph-tools.git
liucxer
ceph-tools
ceph-tools
db53517fcc53

搜索帮助