datafetcher

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	MetricFetcher
}

Fetcher fetch data from datasource and other cluster data, it adapt the different data source You can implement your Fetcher.

type MetricFetcher

type MetricFetcher interface {
	// ContainerCPUUsed return container cpu used metric, result is a map, key is namespace/podname/containername
	ContainerCPUUsed(ctx context.Context, start time.Time, end time.Time, step time.Duration) (map[string]*common.TimeSeries, error)
	// ContainerRAMUsed return container ram used metric unit bytes, result is a map, key is namespace/podname/containername
	ContainerRAMUsed(ctx context.Context, start time.Time, end time.Time, step time.Duration) (map[string]*common.TimeSeries, error)

	// PodCPUUsed return pod cpu used metric, result is a map, key is namespace/podname
	PodCPUUsed(ctx context.Context, start time.Time, end time.Time, step time.Duration) (map[string]*common.TimeSeries, error)
	// PodRAMUsed return ram used metric unit bytes, result is a map, key is namespace/podname
	PodRAMUsed(ctx context.Context, start time.Time, end time.Time, step time.Duration) (map[string]*common.TimeSeries, error)

	// WorkloadCPUUsed return workload cpu used metric for, result is a map, key is namespace/workloadkind/workloadname
	WorkloadCPUUsed(ctx context.Context, start time.Time, end time.Time, step time.Duration) (map[string]*common.TimeSeries, error)
	// WorkloadRAMUsed return workload ram used metric unit bytes, result is a map, key is namespace/workloadkind/workloadname
	WorkloadRAMUsed(ctx context.Context, start time.Time, end time.Time, step time.Duration) (map[string]*common.TimeSeries, error)

	// NodeCPUUsed return node cpu used metric, result is a map, key is nodename
	NodeCPUUsed(ctx context.Context, start time.Time, end time.Time, step time.Duration) (map[string]*common.TimeSeries, error)
	// NodeRAMUsed return node ram used metric unit bytes, result is a map, key is nodename
	NodeRAMUsed(ctx context.Context, start time.Time, end time.Time, step time.Duration) (map[string]*common.TimeSeries, error)
}

MetricFetcher fetches data from datasource metric, it adapt the different data source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL