Documentation ¶
Index ¶
- Constants
- func GetHeader(ctx context.Context, key string) string
- type DailyClusterQuota
- type DailyProjectQuota
- type GaugeData
- type Histogram
- type HistogramSerie
- type PieData
- type PieSerie
- type Quota
- type ReportTable
- type ReportTableOption
- type Resource
- func (r *Resource) FilterCluster(clusters []*clusterpb.ClusterInfo, clusterNames map[string]struct{}) []string
- func (r *Resource) GetClusterPie(ctx context.Context, resourceType string, ...) (clusterPie *PieData, err error)
- func (r *Resource) GetClusterTrend(ctx context.Context, orgId int64, userId string, ...) (td *Histogram, err error)
- func (r *Resource) GetGauge(ctx context.Context, ordId string, userID string, ...) (data map[string]*GaugeData, err error)
- func (r *Resource) GetPie(ctx context.Context, ordId, userId string, request *apistructs.ClassRequest) (data map[string]*PieData, err error)
- func (r *Resource) GetPrincipalPie(ctx context.Context, resType string, ...) (principalPie *PieData, err error)
- func (r *Resource) GetProjectPie(ctx context.Context, resType string, ...) (projectPie *PieData, err error)
- func (r *Resource) GetProjectTrend(ctx context.Context, request *apistructs.TrendRequest) (*Histogram, error)
- func (r *Resource) GetQuotaResource(ctx context.Context, ordId string, userID string, clusterNames []string) (resp *apistructs.ResourceResp, err error)
- func (r *Resource) I18n(lang i18n.LanguageCodes, key string, args ...interface{}) string
- func (r *Resource) Init(ctx servicehub.Context) error
- func (r *Resource) PieSort(series []SerieData)
- type SerieData
- type Series
- type XAxis
- type YAxis
Constants ¶
View Source
const ( CPU = "cpu" Mem = "mem" Memory = "memory" Owner = "owner" Project = "project" Cluster = "cluster" Day = "day" Week = "week" Month = "month" )
View Source
const ( G = 1 << 30 MilliCore = 1000 )
View Source
const Lang = "Lang"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DailyClusterQuota ¶
type DailyProjectQuota ¶
type Histogram ¶
type Histogram struct { XAxis XAxis `json:"xAxis"` YAxis YAxis `json:"yAxis"` Series []HistogramSerie `json:"series"` Name string `json:"name"` }
type HistogramSerie ¶
type ReportTable ¶
type ReportTable struct {
// contains filtered or unexported fields
}
func NewReportTable ¶
func NewReportTable(opts ...ReportTableOption) *ReportTable
func (*ReportTable) GetResourceOverviewReport ¶
func (rt *ReportTable) GetResourceOverviewReport(ctx context.Context, orgID int64, clusterNames []string, cpuPerNode, memPerNode uint64, groupBy string) (*apistructs.ResourceOverviewReportData, error)
type ReportTableOption ¶
type ReportTableOption func(table *ReportTable)
func ReportTableWithBundle ¶
func ReportTableWithBundle(bdl *bundle.Bundle) ReportTableOption
func ReportTableWithCMP ¶
func ReportTableWithCMP(cmp interface { ListSteveResource(ctx context.Context, req *apistructs.SteveRequest) ([]types.APIObject, error) GetNamespacesResources(ctx context.Context, nReq *pb.GetNamespacesResourcesRequest) (*pb.GetNamespacesResourcesResponse, error) }) ReportTableOption
func ReportTableWithTrans ¶
func ReportTableWithTrans(trans i18n.Translator) ReportTableOption
type Resource ¶
type Resource struct { Bdl *bundle.Bundle Ctx context.Context Server cmp_interface.Provider I18N i18n.Translator DB *dbclient.DBClient ClusterSvc clusterpb.ClusterServiceServer }
func New ¶
func New(ctx context.Context, i18n i18n.Translator, mServer cmp_interface.Provider, clusterSvc clusterpb.ClusterServiceServer) *Resource
func (*Resource) FilterCluster ¶
func (r *Resource) FilterCluster(clusters []*clusterpb.ClusterInfo, clusterNames map[string]struct{}) []string
func (*Resource) GetClusterPie ¶
func (*Resource) GetClusterTrend ¶
func (r *Resource) GetClusterTrend(ctx context.Context, orgId int64, userId string, request *apistructs.TrendRequest) (td *Histogram, err error)
func (*Resource) GetGauge ¶
func (r *Resource) GetGauge(ctx context.Context, ordId string, userID string, request *apistructs.GaugeRequest) (data map[string]*GaugeData, err error)
func (*Resource) GetPie ¶
func (r *Resource) GetPie(ctx context.Context, ordId, userId string, request *apistructs.ClassRequest) (data map[string]*PieData, err error)
func (*Resource) GetPrincipalPie ¶
func (r *Resource) GetPrincipalPie(ctx context.Context, resType string, resp *apistructs.GetQuotaOnClustersResponse, resource *apistructs.ResourceResp) (principalPie *PieData, err error)
func (*Resource) GetProjectPie ¶
func (r *Resource) GetProjectPie(ctx context.Context, resType string, resp *apistructs.GetQuotaOnClustersResponse, resource *apistructs.ResourceResp) (projectPie *PieData, err error)
func (*Resource) GetProjectTrend ¶
func (r *Resource) GetProjectTrend(ctx context.Context, request *apistructs.TrendRequest) (*Histogram, error)
func (*Resource) GetQuotaResource ¶
func (r *Resource) GetQuotaResource(ctx context.Context, ordId string, userID string, clusterNames []string) (resp *apistructs.ResourceResp, err error)
Click to show internal directories.
Click to hide internal directories.