Documentation
¶
Index ¶
- type FuncEdgeDB
- type FuncNodeDB
- type FuncTree
- func (s *FuncTree) Close() error
- func (s *FuncTree) GetAllFuncEdges() ([]*callgraph.FuncEdge, error)
- func (s *FuncTree) GetAllFuncNodes() ([]*callgraph.FuncNode, error)
- func (s *FuncTree) GetCalleeEdges(callerKey string) ([]*callgraph.FuncNode, error)
- func (s *FuncTree) GetCallerEdges(calleeKey string) ([]*callgraph.FuncNode, error)
- func (s *FuncTree) GetFuncNodeByKey(key string) (*callgraph.FuncNode, error)
- func (s *FuncTree) InitTable() error
- func (s *FuncTree) SaveFuncEdge(edge *callgraph.FuncEdge) error
- func (s *FuncTree) SaveFuncNode(node *callgraph.FuncNode) error
- type TraceDB
- func (d *TraceDB) Close() error
- func (d *TraceDB) GetAllFunctionName() ([]string, error)
- func (d *TraceDB) GetAllGIDs(page int, limit int) ([]uint64, error)
- func (d *TraceDB) GetAllParentIds() ([]int64, error)
- func (d *TraceDB) GetChildFunctions(parentId int64) ([]string, error)
- func (d *TraceDB) GetFunctionAnalysis(functionName string, queryType string) ([]entity.FunctionNode, error)
- func (d *TraceDB) GetFunctionCallGraph(functionName string, depth int, direction string) (*entity.FunctionCallGraph, error)
- func (d *TraceDB) GetGidsByFunctionName(functionName string) ([]string, error)
- func (d *TraceDB) GetGoroutineCallDepth(gid uint64) (int, error)
- func (d *TraceDB) GetGoroutineExecutionTime(gid uint64) (string, error)
- func (d *TraceDB) GetGoroutineStats() (*entity.GoroutineStats, error)
- func (d *TraceDB) GetHotFunctions(sortBy string) ([]entity.HotFunction, error)
- func (d *TraceDB) GetInitialFunc(gid uint64) (string, error)
- func (d *TraceDB) GetParamsByID(id int32) ([]functrace.TraceParams, error)
- func (d *TraceDB) GetTotalGIDs() (int, error)
- func (d *TraceDB) GetTracesByGID(gid string) ([]entity.TraceData, error)
- func (d *TraceDB) GetTracesByParentId(parentId int64) ([]entity.TraceData, error)
- func (d *TraceDB) GetUnfinishedFunctions(threshold int64) ([]entity.UnfinishedFunction, error)
- func (d *TraceDB) IsGoroutineFinished(gid uint64) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuncEdgeDB ¶
type FuncEdgeDB struct {
ID uint `gorm:"primarykey"` // 主键ID
CreatedAt time.Time `gorm:"index"` // 创建时间
UpdatedAt time.Time // 更新时间
CallerKey string `gorm:"type:varchar(255);index"` // 调用方函数Key
CalleeKey string `gorm:"type:varchar(255);index"` // 被调用方函数Key
}
FuncEdgeDB 函数调用关系的数据库模型
func EdgefromMemModel ¶
func EdgefromMemModel(edge *callgraph.FuncEdge) *FuncEdgeDB
type FuncNodeDB ¶
type FuncNodeDB struct {
ID uint `gorm:"primarykey"` // 主键ID
CreatedAt time.Time `gorm:"index"` // 创建时间
UpdatedAt time.Time // 更新时间
Key string `gorm:"type:varchar(255);unique"` // 函数唯一标识
Pkg string `gorm:"type:varchar(255);index"` // 包名
Name string `gorm:"type:varchar(255)"` // 函数名
}
FuncNodeDB 函数节点的数据库模型
func NodefromMemModel ¶
func NodefromMemModel(node *callgraph.FuncNode) *FuncNodeDB
func (*FuncNodeDB) ToMemModel ¶
func (f *FuncNodeDB) ToMemModel() *callgraph.FuncNode
添加从数据库模型转换回内存模型的方法
type FuncTree ¶
type FuncTree struct {
// contains filtered or unexported fields
}
func NewFuncNodeDB ¶
func (*FuncTree) GetAllFuncEdges ¶ added in v1.1.0
GetAllFuncEdges 获取所有函数调用边
func (*FuncTree) GetAllFuncNodes ¶ added in v1.1.0
GetAllFuncNodes 获取所有函数节点
func (*FuncTree) GetCalleeEdges ¶
GetCalleeEdges 获取该函数调用的所有节点
func (*FuncTree) GetCallerEdges ¶
GetCallerEdges 获取调用该函数的所有节点
func (*FuncTree) GetFuncNodeByKey ¶
GetFuncNodeByKey 根据Key获取函数节点
func (*FuncTree) SaveFuncEdge ¶
SaveFuncEdge 保存函数调用关系
type TraceDB ¶
type TraceDB struct {
// contains filtered or unexported fields
}
func NewTraceDB ¶
func (*TraceDB) GetAllFunctionName ¶
func (*TraceDB) GetAllParentIds ¶ added in v1.1.1
GetAllParentIds 获取所有的父函数ID
func (*TraceDB) GetChildFunctions ¶ added in v1.1.0
GetChildFunctions 获取函数的子函数
func (*TraceDB) GetFunctionAnalysis ¶ added in v1.1.0
func (d *TraceDB) GetFunctionAnalysis(functionName string, queryType string) ([]entity.FunctionNode, error)
GetFunctionAnalysis 获取函数调用关系分析
func (*TraceDB) GetFunctionCallGraph ¶ added in v1.1.0
func (d *TraceDB) GetFunctionCallGraph(functionName string, depth int, direction string) (*entity.FunctionCallGraph, error)
GetFunctionCallGraph 获取函数调用关系图
func (*TraceDB) GetGidsByFunctionName ¶
func (*TraceDB) GetGoroutineCallDepth ¶ added in v1.1.0
GetGoroutineCallDepth 获取指定 Goroutine 的最大调用深度
func (*TraceDB) GetGoroutineExecutionTime ¶ added in v1.1.0
func (*TraceDB) GetGoroutineStats ¶ added in v1.1.0
func (d *TraceDB) GetGoroutineStats() (*entity.GoroutineStats, error)
GetGoroutineStats 获取Goroutine统计信息
func (*TraceDB) GetHotFunctions ¶ added in v1.1.0
func (d *TraceDB) GetHotFunctions(sortBy string) ([]entity.HotFunction, error)
GetHotFunctions 获取热点函数分析数据
func (*TraceDB) GetParamsByID ¶
func (d *TraceDB) GetParamsByID(id int32) ([]functrace.TraceParams, error)
func (*TraceDB) GetTotalGIDs ¶
func (*TraceDB) GetTracesByGID ¶
func (*TraceDB) GetTracesByParentId ¶ added in v1.1.1
GetTracesByParentId 根据父函数ID查询函数调用
func (*TraceDB) GetUnfinishedFunctions ¶ added in v1.1.1
func (d *TraceDB) GetUnfinishedFunctions(threshold int64) ([]entity.UnfinishedFunction, error)
GetUnfinishedFunctions 获取未完成的函数列表
Click to show internal directories.
Click to hide internal directories.