From e3780f1cb2b408119e3d56afd8adc150713b8556 Mon Sep 17 00:00:00 2001 From: Wangjunqi123 Date: Thu, 14 Sep 2023 18:14:38 +0800 Subject: [PATCH] fix net node and net-to-net edge missing bug --- topology/server/agentmanager/init.go | 6 +++--- topology/server/agentmanager/topoclient.go | 1 + topology/server/processor/processor.go | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/topology/server/agentmanager/init.go b/topology/server/agentmanager/init.go index 9749d000..5f71ecf3 100644 --- a/topology/server/agentmanager/init.go +++ b/topology/server/agentmanager/init.go @@ -4,13 +4,13 @@ import ( "gitee.com/openeuler/PilotGo-plugins/sdk/plugin/client" ) -const Version = "0.0.1" +const Version = "1.0.1" var PluginInfo = &client.PluginInfo{ - Name: "topo", + Name: "topology", Version: Version, Description: "system application architecture perception", Author: "wangjunqi", Email: "wangjunqi@kylinos.cn", - Url: "http://192.168.75.100:9995/plugin/topo", + Url: "http://10.1.10.131:9991/plugin/topology", } diff --git a/topology/server/agentmanager/topoclient.go b/topology/server/agentmanager/topoclient.go index dbcf4bd1..deef5730 100644 --- a/topology/server/agentmanager/topoclient.go +++ b/topology/server/agentmanager/topoclient.go @@ -70,6 +70,7 @@ func (t *Topoclient) InitLogger() { } func (t *Topoclient) InitPluginClient() { + PluginInfo.Url = "http://" + conf.Config().Topo.Server_addr + "/plugin/topology" PluginClient := client.DefaultClient(PluginInfo) PluginClient.Server = "http://" + conf.Config().PilotGo.Addr Topo = &Topoclient{ diff --git a/topology/server/processor/processor.go b/topology/server/processor/processor.go index a11f43da..3b59b4de 100644 --- a/topology/server/processor/processor.go +++ b/topology/server/processor/processor.go @@ -3,6 +3,7 @@ package processor import ( "fmt" "strconv" + "strings" "sync" "gitee.com/openeuler/PilotGo-plugin-topology-server/agentmanager" @@ -155,7 +156,7 @@ func (d *DataProcesser) Create_node_entities(agent *agentmanager.Agent_m, nodes // 临时定义不含网络流量metric的网络节点 for _, net := range agent.Netconnections_2 { net_node := &meta.Node{ - ID: fmt.Sprintf("%s_%s_%d", agent.UUID, meta.NODE_NET, net.Pid), + ID: fmt.Sprintf("%s_%s_%d:%s", agent.UUID, meta.NODE_NET, net.Pid, strings.Split(net.Laddr, ":")[1]), Name: net.Laddr, Type: meta.NODE_NET, UUID: agent.UUID, -- Gitee