- Add GetMetrics method to MetricsClient interface and implement cluster metrics API - Add QuotaPrecheck service for validating resource quotas before deployment - Add auth DTO with role/permission models and auth handler tests - Add instance diagnostics: mounted NFS volumes, labels, annotations in pod diagnostics - Update workspace handler with GetWorkspace endpoint and shared-user list - Fix monitoring handler to use correct service method name - Add tail_lines fallback in instance handler for snake_case query params - Update nginx config for SSE log streaming support (no buffering) - Add comprehensive test coverage: auth_service_test, auth_handler_test, auth_dto_test, metrics_client_test, quota_precheck_test - Update error messages for quota validation and instance operations - ModifyModal: fix YAML lineWidth:0, modified keys summary, delta-only submit - InstanceCard: correctly disable scale-minus when replicas <= 0 - SidebarLayout: add hover transition for sidebar items - Update todo.md and lessons.md with latest fixes
20 lines
648 B
Go
20 lines
648 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/ocdp/cluster-service/internal/domain/entity"
|
|
)
|
|
|
|
// MetricsClient 定义获取集群监控指标的接口
|
|
type MetricsClient interface {
|
|
// GetClusterMetrics 获取集群的监控指标
|
|
GetClusterMetrics(ctx context.Context, clusterID string) (*entity.ClusterMetrics, error)
|
|
|
|
// GetNodeMetrics 获取集群的节点指标
|
|
GetNodeMetrics(ctx context.Context, clusterID string) ([]*entity.NodeMetrics, error)
|
|
|
|
// GetPodResourceAllocations returns Pod requests/limits grouped by Pod.
|
|
GetPodResourceAllocations(ctx context.Context, clusterID string) ([]*entity.PodResourceAllocation, error)
|
|
}
|