新增通过nodeid获取nodename接口

This commit is contained in:
boyce
2019-04-29 15:23:36 +08:00
parent f2c5f43b1f
commit 529ba2248a
3 changed files with 15 additions and 0 deletions

View File

@@ -494,3 +494,8 @@ func (slf *CCluster) AddLocalService(iservice service.IService) {
servicename = parts[1]
slf.innerLocalServiceList[servicename] = true
}
func GetNodeName(nodeid int) string {
//
return _self.cfg.GetNodeNameByNodeId(nodeid)
}

View File

@@ -156,3 +156,12 @@ func IsExistsNode(nodelist []CNode, pNode *CNode) bool {
return false
}
func (slf *ClusterConfig) GetNodeNameByNodeId(nodeid int) string {
node, ok := slf.mapIdNode[nodeid]
if ok == false {
return ""
}
return node.NodeName
}

View File

@@ -54,6 +54,7 @@ func (slf *PProfService) HTTP_DebugPProf(request *HttpRequest, resp *HttpRespone
func (slf *PProfService) RPC_DebugPProf(arg *string, ret *Profilestruct) error {
ret.Fisttime = slf.fisttime
for _, p := range pprof.Profiles() {
ret.ProfileList = append(ret.ProfileList, ProfileData{
Name: p.Name(),