Documentation ¶
Index ¶
Constants ¶
View Source
const ( KindReplicaSet = "ReplicaSet" KindDaemonSet = "DaemonSet" KindStatefulSet = "StatefulSet" )
View Source
const ( DefaultPort = 2000 DefaultScrapeInterval = time.Minute DefaultMetricDuration = 7 * 24 * time.Hour DefaultReClusterTime = 1 * time.Hour DefaultNumRound = 30 DefaultNumClass = 20 )
View Source
const PodListUrl = "http://localhost:8001/api/v1/pods"
View Source
const PodMetricsListUrl = "http://localhost:8001/apis/metrics.k8s.io/v1beta1/pods"
Variables ¶
This section is empty.
Functions ¶
func NewDatabaseDatasource ¶
Types ¶
type AppClassDO ¶
type AppPodMetricsDO ¶
type ClassSectionMetricsDO ¶
type Server ¶
type Server interface {
Start() error
}
func NewServer ¶
func NewServer(config *ServerConfig) (Server, error)
type ServerConfig ¶
type ServerConfig struct { MetricDuration time.Duration // 给每个应用保留的数据的时间长度 Port uint16 // 本服务器监听端口 ScrapeInterval time.Duration // 从metrics server获取数据的周期。至少为15s。 ReClusterTime time.Duration // 再聚类的时间 NumClass uint // 类别数量 NumRound uint // 聚类迭代轮次 InitialCenterCsvFile string // 初始各类中心的数据文件。若不是空,则会清空数据库的数据并读取。若为空,则使用数据库数据,此时如果数据库没有类别数据,则会产生错误。 MysqlHost string }
func (*ServerConfig) Complete ¶
func (config *ServerConfig) Complete() error
func (ServerConfig) String ¶
func (s ServerConfig) String() string
Click to show internal directories.
Click to hide internal directories.