代码拉取完成,页面将自动刷新
package ceph_cluster
import (
"github.com/sirupsen/logrus"
"time"
)
func (cluster *CephCluster) ClearOsdLog(osdNums []int64) error {
startTime := time.Now()
logrus.Debugf("ClearOsdLog start. ")
defer func() {
cost := time.Now().Sub(startTime).Seconds()
logrus.Debugf("ClearOsdLog end. cost:%f", cost)
}()
for _, client := range cluster.Clients {
err := client.ClearOsdLog(osdNums)
if err != nil {
logrus.Errorf("host :%s, ExecCmd: err:%v", client.IpAddr, err)
return err
}
}
return nil
}
func (cluster *CephCluster) ClearCephLog() error {
startTime := time.Now()
logrus.Debugf("ClearCephLog start. ")
defer func() {
cost := time.Now().Sub(startTime).Seconds()
logrus.Debugf("ClearCephLog end. cost:%f", cost)
}()
for _, client := range cluster.Clients {
err := client.ClearCephLog()
if err != nil {
logrus.Errorf("host :%s, ExecCmd: err:%v", client.IpAddr, err)
return err
}
}
return nil
}
func (cluster *CephCluster) CollectOsdLog(dstDir string, osdNums []int64) error {
var (
err error
)
startTime := time.Now()
logrus.Debugf("CollectOsdLog start. ")
defer func() {
cost := time.Now().Sub(startTime).Seconds()
logrus.Debugf("CollectOsdLog end. cost:%f", cost)
}()
for _, client := range cluster.Clients {
err = client.CollectOsdLog(dstDir, osdNums)
if err != nil {
return err
}
}
return nil
}
func (cluster *CephCluster) CollectCephLog(dstDir string) error {
var (
err error
)
startTime := time.Now()
logrus.Debugf("CollectCephLog start. ")
defer func() {
cost := time.Now().Sub(startTime).Seconds()
logrus.Debugf("CollectCephLog end. cost:%f", cost)
}()
for _, client := range cluster.Clients {
err = client.CollectCephLog(dstDir)
if err != nil {
return err
}
}
return nil
}
func (cluster *CephCluster) BackupAndClearCephLog() error {
startTime := time.Now()
logrus.Debugf("BackupAndClearCephLog start. ")
defer func() {
cost := time.Now().Sub(startTime).Seconds()
logrus.Debugf("BackupAndClearCephLog end. cost:%f", cost)
}()
for _, client := range cluster.Clients {
err := client.BackupAndClearCephLog()
if err != nil {
return err
}
}
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。