17 Star 5 Fork 15

openEuler/PilotGo-plugin-topology

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
main.go 2.49 KB
Copy Edit Raw Blame History
无名 authored 2025-01-21 15:23 +08:00 . update sdk
/*
* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved.
* PilotGo-plugin-topology licensed under the Mulan Permissive Software License, Version 2.
* See LICENSE file for more details.
* Author: Wangjunqi123 <wangjunqi@kylinos.cn>
* Date: Mon Nov 4 14:30:13 2024 +0800
*/
package main
import (
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/agentmanager"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/conf"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/db"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/db/mysqlmanager"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/global"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/webserver"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/logger"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/pluginclient"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/resourcemanage"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/service"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/service/webclient"
"gitee.com/openeuler/PilotGo-plugin-topology/cmd/server/signal"
sdklogger "gitee.com/openeuler/PilotGo/sdk/logger"
// "github.com/pyroscope-io/pyroscope/pkg/cmd/agent/profiler"
)
func main() {
// profiler.Start(profiler.Config{
// ApplicationName: "topo-server",
// ServerAddress: "http://localhost:4040",
// })
/*
init config
main.go中第一个执行的初始化模块,省略Global_Config全局指针变量调用的非空检测
*/
conf.InitConfig()
/*
init logger
*/
logger.InitLogger()
/*
init error control、resource release、goroutine end management
*/
ermanager, err := resourcemanage.CreateErrorReleaseManager(global.RootContext, global.Close)
if err != nil {
sdklogger.Fatal("%s", err.Error())
}
global.ERManager = ermanager
/*
init plugin client
*/
pluginclient.InitPluginClient()
/*
init agent manager
*/
agentmanager.InitAgentManager()
/*
init database
neo4j mysql redis prometheus
*/
db.InitDB()
/*
浏览器客户端
*/
webclient.InitWebClientsManager()
/*
init web server
*/
webserver.InitWebServer()
/*
init machine agent list
*/
agentmanager.Global_AgentManager.InitMachineList()
/*
topo插件自身数据采集模块周期性数据采集: 全局网络拓扑、单机拓扑
*/
service.InitPeriodCollectWorking([]string{}, [][]mysqlmanager.Filter_rule{})
/*
终止进程信号监听
main.go中最后执行,不进行全局指针变量非空检测
*/
signal.SignalMonitoring()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler/PilotGo-plugin-topology.git
git@gitee.com:openeuler/PilotGo-plugin-topology.git
openeuler
PilotGo-plugin-topology
PilotGo-plugin-topology
d8282c0a164a

Search