mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-01-06 23:45:47 +08:00
实现基础的统计指标
This commit is contained in:
@@ -641,7 +641,21 @@ func (this *NodeDAO) ComposeNodeConfig(tx *dbs.Tx, nodeId int64) (*nodeconfigs.N
|
||||
}
|
||||
|
||||
// 指标
|
||||
|
||||
metricItemIds, err := SharedNodeClusterMetricItemDAO.FindAllClusterItemIds(tx, int64(node.ClusterId))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var metricItems = []*serverconfigs.MetricItemConfig{}
|
||||
for _, itemId := range metricItemIds {
|
||||
itemConfig, err := SharedMetricItemDAO.ComposeItemConfig(tx, itemId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if itemConfig != nil {
|
||||
metricItems = append(metricItems, itemConfig)
|
||||
}
|
||||
}
|
||||
config.MetricItems = metricItems
|
||||
|
||||
return config, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user