实现基础的统计指标

This commit is contained in:
刘祥超
2021-06-30 19:59:49 +08:00
parent 98a2d61fd1
commit 54dbe1f3e4
22 changed files with 429 additions and 117 deletions

View File

@@ -5,7 +5,6 @@ package services
import (
"context"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/db/models/metrics"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/types"
)
@@ -59,13 +58,13 @@ func (this *NodeClusterMetricItemService) FindAllNodeClusterMetricItems(ctx cont
}
var tx = this.NullTx()
clusterItems, err := models.SharedNodeClusterMetricItemDAO.FindAllClusterItems(tx, req.NodeClusterId, req.Category)
clusterItems, err := models.SharedNodeClusterMetricItemDAO.FindAllClusterItems(tx, req.NodeClusterId, req.Category)
if err != nil {
return nil, err
}
var pbItems = []*pb.MetricItem{}
for _, clusterItem := range clusterItems {
item, err := metrics.SharedMetricItemDAO.FindEnabledMetricItem(tx, int64(clusterItem.ItemId))
item, err := models.SharedMetricItemDAO.FindEnabledMetricItem(tx, int64(clusterItem.ItemId))
if err != nil {
return nil, err
}