Documentation
¶
Index ¶
- Constants
- Variables
- func CollectQueueMetrics(queueCounts map[string]int, metricsProvider QueueMetricProvider) []prometheus.Metric
- func Describe(out chan<- *prometheus.Desc)
- func NewClusterAvailableCapacity(value float64, cluster string, pool string, resource string, nodeType string) prometheus.Metric
- func NewClusterTotalCapacity(value float64, cluster string, pool string, resource string, nodeType string) prometheus.Metric
- func NewCountQueueResources(value uint64, pool string, priorityClass string, queue string, resource string) prometheus.Metric
- func NewJobRunRunDuration(count uint64, sum float64, buckets map[float64]uint64, pool string, ...) prometheus.Metric
- func NewMaxJobRunDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
- func NewMaxQueueAllocated(value float64, pool string, priorityClass string, queue string, ...) prometheus.Metric
- func NewMaxQueueDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
- func NewMaxQueueResources(value float64, pool string, priorityClass string, queue string, ...) prometheus.Metric
- func NewMedianJobRunDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
- func NewMedianQueueAllocated(value float64, pool string, priorityClass string, queue string, ...) prometheus.Metric
- func NewMedianQueueDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
- func NewMedianQueueResources(value float64, pool string, priorityClass string, queue string, ...) prometheus.Metric
- func NewMinJobRunDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
- func NewMinQueueAllocated(value float64, pool string, priorityClass string, queue string, ...) prometheus.Metric
- func NewMinQueueDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
- func NewMinQueueResources(value float64, pool string, priorityClass string, queue string, ...) prometheus.Metric
- func NewQueueAllocated(value float64, queue string, cluster string, pool string, resource string, ...) prometheus.Metric
- func NewQueueDuration(count uint64, sum float64, buckets map[float64]uint64, pool string, ...) prometheus.Metric
- func NewQueueLeasedPodCount(value float64, cluster string, pool string, queue string, phase string, ...) prometheus.Metric
- func NewQueueResources(value float64, pool string, priorityClass string, queue string, ...) prometheus.Metric
- func NewQueueSizeMetric(value int, queue string) prometheus.Metric
- func NewQueueUsed(value float64, queue string, cluster string, pool string, resource string, ...) prometheus.Metric
- type FloatMetrics
- type FloatMetricsRecorder
- type HttpMetricsProvider
- type JobMetricsRecorder
- type ManualMetricsProvider
- type MetricsProvider
- type QueueMetricProvider
- type QueueMetrics
- type QueueMetricsRecorder
- type ResourceMetrics
- type ResourceMetricsRecorder
Constants ¶
View Source
const MetricPrefix = "armada_"
Variables ¶
View Source
var AllDescs = []*prometheus.Desc{
QueueSizeDesc,
QueuePriorityDesc,
QueueResourcesDesc,
MinQueueResourcesDesc,
MaxQueueResourcesDesc,
MedianQueueResourcesDesc,
CountQueueResourcesDesc,
MinQueueDurationDesc,
MaxQueueDurationDesc,
MedianQueueDurationDesc,
MedianQueueDurationDesc,
QueueDurationDesc,
MinJobRunDurationDesc,
MaxJobRunDurationDesc,
MedianJobRunDurationDesc,
JobRunDurationDesc,
QueueAllocatedDesc,
MinQueueAllocatedDesc,
MaxQueueAllocatedDesc,
MedianQueueAllocatedDesc,
QueueUsedDesc,
QueueLeasedPodCountDesc,
ClusterCapacityDesc,
ClusterAvailableCapacityDesc,
}
View Source
var ClusterAvailableCapacityDesc = prometheus.NewDesc(
MetricPrefix+"cluster_available_capacity",
"Cluster capacity available for Armada jobs",
[]string{"cluster", "pool", "resourceType", "nodeType"},
nil,
)
View Source
var ClusterCapacityDesc = prometheus.NewDesc(
MetricPrefix+"cluster_capacity",
"Cluster capacity",
[]string{"cluster", "pool", "resourceType", "nodeType"},
nil,
)
View Source
var CountQueueResourcesDesc = prometheus.NewDesc(
MetricPrefix+"queue_resource_queued_count",
"Count of queued jobs requiring resource",
[]string{"pool", "priorityClass", "queueName", "resourceType"},
nil,
)
View Source
var JobRunDurationDesc = prometheus.NewDesc(
MetricPrefix+"job_run_time_seconds",
"Run time for Armada jobs",
[]string{"pool", "priorityClass", "queueName"},
nil,
)
View Source
var MaxJobRunDurationDesc = prometheus.NewDesc(
MetricPrefix+"job_run_time_seconds_max",
"Max run time for Armada jobs",
[]string{"pool", "priorityClass", "queueName"},
nil,
)
View Source
var MaxQueueAllocatedDesc = prometheus.NewDesc(
MetricPrefix+"queue_resource_allocated_max",
"Max resource allocated by a running job",
[]string{"pool", "priorityClass", "queueName", "resourceType"},
nil,
)
View Source
var MaxQueueDurationDesc = prometheus.NewDesc(
MetricPrefix+"job_queued_seconds_max",
"Max queue time for Armada jobs",
[]string{"pool", "priorityClass", "queueName"},
nil,
)
View Source
var MaxQueueResourcesDesc = prometheus.NewDesc(
MetricPrefix+"queue_resource_queued_max",
"Max resource required by queued job",
[]string{"pool", "priorityClass", "queueName", "resourceType"},
nil,
)
View Source
var MedianJobRunDurationDesc = prometheus.NewDesc(
MetricPrefix+"job_run_time_seconds_median",
"Median run time for Armada jobs",
[]string{"pool", "priorityClass", "queueName"},
nil,
)
View Source
var MedianQueueAllocatedDesc = prometheus.NewDesc(
MetricPrefix+"queue_resource_allocated_median",
"Median resource allocated by a running job",
[]string{"pool", "priorityClass", "queueName", "resourceType"},
nil,
)
View Source
var MedianQueueDurationDesc = prometheus.NewDesc(
MetricPrefix+"job_queued_seconds_median",
"Median queue time for Armada jobs",
[]string{"pool", "priorityClass", "queueName"},
nil,
)
View Source
var MedianQueueResourcesDesc = prometheus.NewDesc(
MetricPrefix+"queue_resource_queued_median",
"Median resource required by queued jobs",
[]string{"pool", "priorityClass", "queueName", "resourceType"},
nil,
)
View Source
var MinJobRunDurationDesc = prometheus.NewDesc(
MetricPrefix+"job_run_time_seconds_min",
"Min run time for Armada jobs",
[]string{"pool", "priorityClass", "queueName"},
nil,
)
View Source
var MinQueueAllocatedDesc = prometheus.NewDesc(
MetricPrefix+"queue_resource_allocated_min",
"Min resource allocated by a running job",
[]string{"pool", "priorityClass", "queueName", "resourceType"},
nil,
)
View Source
var MinQueueDurationDesc = prometheus.NewDesc(
MetricPrefix+"job_queued_seconds_min",
"Min queue time for Armada jobs",
[]string{"pool", "priorityClass", "queueName"},
nil,
)
View Source
var MinQueueResourcesDesc = prometheus.NewDesc(
MetricPrefix+"queue_resource_queued_min",
"Min resource required by queued job",
[]string{"pool", "priorityClass", "queueName", "resourceType"},
nil,
)
View Source
var QueueAllocatedDesc = prometheus.NewDesc(
MetricPrefix+"queue_resource_allocated",
"Resource allocated to running jobs of a queue",
[]string{"cluster", "pool", "queueName", "resourceType", "nodeType"},
nil,
)
View Source
var QueueDurationDesc = prometheus.NewDesc(
MetricPrefix+"job_queued_seconds",
"Queued time for Armada jobs",
[]string{"pool", "priorityClass", "queueName"},
nil,
)
View Source
var QueueLeasedPodCountDesc = prometheus.NewDesc(
MetricPrefix+"queue_leased_pod_count",
"Number of leased pods",
[]string{"cluster", "pool", "queueName", "phase", "nodeType"},
nil,
)
View Source
var QueuePriorityDesc = prometheus.NewDesc(
MetricPrefix+"queue_priority",
"Priority of a queue",
[]string{"pool", "queueName"},
nil,
)
View Source
var QueueResourcesDesc = prometheus.NewDesc(
MetricPrefix+"queue_resource_queued",
"Resource required by queued jobs",
[]string{"pool", "priorityClass", "queueName", "resourceType"},
nil,
)
View Source
var QueueSizeDesc = prometheus.NewDesc(
MetricPrefix+"queue_size",
"Number of jobs in a queue",
[]string{"queueName"},
nil,
)
View Source
var QueueUsedDesc = prometheus.NewDesc(
MetricPrefix+"queue_resource_used",
"Resource actually being used by running jobs of a queue",
[]string{"cluster", "pool", "queueName", "resourceType", "nodeType"},
nil,
)
Functions ¶
func CollectQueueMetrics ¶
func CollectQueueMetrics(queueCounts map[string]int, metricsProvider QueueMetricProvider) []prometheus.Metric
func NewClusterAvailableCapacity ¶ added in v0.3.66
func NewClusterAvailableCapacity(value float64, cluster string, pool string, resource string, nodeType string) prometheus.Metric
func NewClusterTotalCapacity ¶ added in v0.3.66
func NewClusterTotalCapacity(value float64, cluster string, pool string, resource string, nodeType string) prometheus.Metric
func NewCountQueueResources ¶
func NewCountQueueResources(value uint64, pool string, priorityClass string, queue string, resource string) prometheus.Metric
func NewJobRunRunDuration ¶
func NewJobRunRunDuration(count uint64, sum float64, buckets map[float64]uint64, pool string, priorityClass string, queue string) prometheus.Metric
func NewMaxJobRunDuration ¶
func NewMaxJobRunDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
func NewMaxQueueAllocated ¶
func NewMaxQueueAllocated(value float64, pool string, priorityClass string, queue string, resource string) prometheus.Metric
func NewMaxQueueDuration ¶
func NewMaxQueueDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
func NewMaxQueueResources ¶
func NewMaxQueueResources(value float64, pool string, priorityClass string, queue string, resource string) prometheus.Metric
func NewMedianJobRunDuration ¶
func NewMedianJobRunDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
func NewMedianQueueAllocated ¶
func NewMedianQueueAllocated(value float64, pool string, priorityClass string, queue string, resource string) prometheus.Metric
func NewMedianQueueDuration ¶
func NewMedianQueueDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
func NewMedianQueueResources ¶
func NewMedianQueueResources(value float64, pool string, priorityClass string, queue string, resource string) prometheus.Metric
func NewMinJobRunDuration ¶
func NewMinJobRunDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
func NewMinQueueAllocated ¶
func NewMinQueueAllocated(value float64, pool string, priorityClass string, queue string, resource string) prometheus.Metric
func NewMinQueueDuration ¶
func NewMinQueueDuration(value float64, pool string, priorityClass string, queue string) prometheus.Metric
func NewMinQueueResources ¶
func NewMinQueueResources(value float64, pool string, priorityClass string, queue string, resource string) prometheus.Metric
func NewQueueAllocated ¶ added in v0.3.66
func NewQueueAllocated(value float64, queue string, cluster string, pool string, resource string, nodeType string) prometheus.Metric
func NewQueueDuration ¶
func NewQueueDuration(count uint64, sum float64, buckets map[float64]uint64, pool string, priorityClass string, queue string) prometheus.Metric
func NewQueueLeasedPodCount ¶ added in v0.3.66
func NewQueueLeasedPodCount(value float64, cluster string, pool string, queue string, phase string, nodeType string) prometheus.Metric
func NewQueueResources ¶
func NewQueueResources(value float64, pool string, priorityClass string, queue string, resource string) prometheus.Metric
func NewQueueSizeMetric ¶
func NewQueueSizeMetric(value int, queue string) prometheus.Metric
func NewQueueUsed ¶ added in v0.3.66
func NewQueueUsed(value float64, queue string, cluster string, pool string, resource string, nodeType string) prometheus.Metric
Types ¶
type FloatMetrics ¶
type FloatMetrics struct {
// contains filtered or unexported fields
}
func (*FloatMetrics) GetBuckets ¶
func (d *FloatMetrics) GetBuckets() map[float64]uint64
type FloatMetricsRecorder ¶
type FloatMetricsRecorder struct {
// contains filtered or unexported fields
}
func NewDefaultJobDurationMetricsRecorder ¶
func NewDefaultJobDurationMetricsRecorder() *FloatMetricsRecorder
func NewFloatMetricsRecorder ¶
func NewFloatMetricsRecorder(buckets ...float64) *FloatMetricsRecorder
func (*FloatMetricsRecorder) GetMetrics ¶
func (d *FloatMetricsRecorder) GetMetrics() *FloatMetrics
type HttpMetricsProvider ¶ added in v0.3.91
type HttpMetricsProvider struct {
// contains filtered or unexported fields
}
HttpMetricsProvider is a metrics provider scraping metrics from a url.
func NewHttpMetricsProvider ¶ added in v0.3.91
func NewHttpMetricsProvider(url string, client *http.Client) *HttpMetricsProvider
type JobMetricsRecorder ¶
type JobMetricsRecorder struct {
// contains filtered or unexported fields
}
func NewJobMetricsRecorder ¶
func NewJobMetricsRecorder() *JobMetricsRecorder
func (*JobMetricsRecorder) RecordJobRuntime ¶
func (r *JobMetricsRecorder) RecordJobRuntime(pool string, priorityClass string, jobRuntime time.Duration)
func (*JobMetricsRecorder) RecordResources ¶
func (r *JobMetricsRecorder) RecordResources(pool string, priorityClass string, resources armadaresource.ComputeResourcesFloat)
type ManualMetricsProvider ¶ added in v0.3.91
type ManualMetricsProvider struct {
// contains filtered or unexported fields
}
func (*ManualMetricsProvider) Collect ¶ added in v0.3.91
func (srv *ManualMetricsProvider) Collect(_ context.Context, _ *logrus.Entry) (map[string]float64, error)
func (*ManualMetricsProvider) WithCollectionDelay ¶ added in v0.3.91
func (srv *ManualMetricsProvider) WithCollectionDelay(d time.Duration) *ManualMetricsProvider
func (*ManualMetricsProvider) WithMetrics ¶ added in v0.3.91
func (srv *ManualMetricsProvider) WithMetrics(metrics map[string]float64) *ManualMetricsProvider
type MetricsProvider ¶ added in v0.3.91
type MetricsProvider interface {
Collect(context.Context, *logrus.Entry) (map[string]float64, error)
}
type QueueMetricProvider ¶
type QueueMetricProvider interface {
GetQueuedJobMetrics(queueName string) []*QueueMetrics
GetRunningJobMetrics(queueName string) []*QueueMetrics
}
type QueueMetrics ¶
type QueueMetrics struct {
Pool string
PriorityClass string
Resources ResourceMetrics
Durations *FloatMetrics
}
type QueueMetricsRecorder ¶
type QueueMetricsRecorder struct {
Pool string
PriorityClass string
// contains filtered or unexported fields
}
type ResourceMetrics ¶
type ResourceMetrics map[string]*FloatMetrics
type ResourceMetricsRecorder ¶
type ResourceMetricsRecorder struct {
// contains filtered or unexported fields
}
func NewResourceMetricsRecorder ¶
func NewResourceMetricsRecorder() *ResourceMetricsRecorder
func (*ResourceMetricsRecorder) GetMetrics ¶
func (d *ResourceMetricsRecorder) GetMetrics() ResourceMetrics
Click to show internal directories.
Click to hide internal directories.