Versions in this module Expand all Collapse all v0 v0.14.7-rc1 May 10, 2023 v0.14.6 Mar 23, 2023 Changes in this version + const ApiNameLabel + const MetricApiDuration + const MetricRunDuration + const MetricRunJobDuration + const RequestIDLabel + const RequestMethodLabel + const ResponseCodeLabel + const RunIDLabel + const RunJobIDLabel + const RunJobStageLabel + const RunStageLabel + const RunStepNameLabel + const RunStepStageLabel + const StageJobAftertreatmentEndTime + const StageJobAftertreatmentStartTime + const StageJobCreateEndTime + const StageJobScheduleEndTime + const StageJobScheduleStartTime + const StageRunAftertreatmentDuration + const StageRunAftertreatmentStartTime + const StageRunEndTime + const StageRunExecuteDuration + const StageRunJobAftertreatmentDuration + const StageRunJobCreateDuration + const StageRunJobScheduleDuration + const StageRunParseDuration + const StageRunParseEndTime + const StageRunParseStartTime + const StageRunStartTime + const StageRunValidateDuration + const StageRunValidateEndTime + const StageRunValidateStartTime + const StageStepScheduleStartTime + var APiDurationSummary = prometheus.NewSummaryVec(prometheus.SummaryOpts{ ... }, []string{ ... }) + var RunMetricManger *RunRecorderManager + type JobStageTimeRecorder struct + JobID string + RunID string + Status schema.JobStatus + StepName string + func NewJobStageTimeRecorder(jobID string, stepName string, runID string) *JobStageTimeRecorder + type MetricRunCollector struct + func NewMetricRunCollector() *MetricRunCollector + func (rm *MetricRunCollector) Collect(ch chan<- prometheus.Metric) + func (rm *MetricRunCollector) Describe(descs chan<- *prometheus.Desc) + type RunRecorderManager struct + Cache gcache.Cache + func NewRunRecorderManager() *RunRecorderManager + func (m *RunRecorderManager) AddJobStageTimeRecord(runID, stepName, jobID string, status schema.JobStatus, stage stageTimeType, ...) + func (m *RunRecorderManager) AddRunStageTimeRecord(runID, requestID, status string, stage stageTimeType, timestamp time.Time) + func (m *RunRecorderManager) AddStepStageTimeRecord(runID, stepName string, stage stageTimeType, timestamp time.Time) + type RunStageTimeRecorder struct + RequestID string + RunID string + Status string + StepStages sync.Map + func NewRunStageTimeRecorder(runID, reqID string) *RunStageTimeRecorder + type StageTimeRecorder struct + LoggerMeta string + StageTime sync.Map + Support []stageTimeType + func NewStageTimeRecorder(suppport []stageTimeType, loggerMeta string) *StageTimeRecorder + type StepStageTimeRecorder struct + JobStages sync.Map + RunID string + StepName string + func NewStepStageTimeRecorder(stepName string, runID string) *StepStageTimeRecorder v0.14.6-beta0 Nov 24, 2022 v0.14.5 Nov 4, 2022 Changes in this version + const BaiduGpuIndexLabel + const GpuIdxLabel + const MetricJobGPUInfo + const PromQLQueryPodAnnotations + const PromQLQueryPodLabels + const QueryTimeout + func GetAnnotationsFromRuntimeInfo(info interface{}) map[string]string + func GetQueryLabelsFromPrometheus(query string) map[string]string + type ListJobFunc func() []model.Job type TimePointManager + var PromAPIClient prom_v1.API v0.14.4 Sep 9, 2022 Changes in this version + const DefaultMetricPort + const FinishedStatusLabel + const JobIDLabel + const MaxNum + const MaxStatus + const MaxTimePoint + const MetricJobCount + const MetricJobTime + const MetricQueueInfo + const MinStatus + const MinTimePoint + const QueueIDLabel + const QueueNameLabel + const QueueTypeMaxResource + const QueueTypeMinResource + const QueueTypeScalarResource + const ResourceLabel + const StatusLabel + const Timeout + const TypeLabel + const UserNameLabel + const ZeroDuration + var ZeroTime = time.Time + func InitMetrics() + func StartMetricsService(port int, queueFunc ListQueueFunc) string + type Info map[string]string + type JobMetricCollector struct + func NewJobMetricsCollector(manager TimePointManager) *JobMetricCollector + func (j *JobMetricCollector) Collect(metrics chan<- prometheus.Metric) + func (j *JobMetricCollector) Describe(descs chan<- *prometheus.Desc) + type JobStatus int + const StatusCreating + const StatusDBInserting + const StatusDequeue + const StatusEnqueue + const StatusPending + const StatusRunning + const StatusSubmitting + const StatusUnknown + func (j JobStatus) String() string + func (j JobStatus) TimePoint() (start TimePoint, end TimePoint) + type JobTimePoint int + const T1 + const T2 + const T3 + const T4 + const T5 + const T6 + const T7 + const T8 + func (t JobTimePoint) Index() int + func (t JobTimePoint) Status() Status + type ListQueueFunc func() []model.Queue + type QueueMetricCollector struct + func NewQueueMetricsCollector(queueFunc ListQueueFunc) *QueueMetricCollector + func (q *QueueMetricCollector) Collect(metrics chan<- prometheus.Metric) + func (q *QueueMetricCollector) Describe(descs chan<- *prometheus.Desc) + type Status interface + String func() string + TimePoint func() (start TimePoint, end TimePoint) + type TimePoint interface + Index func() int + Status func() Status + type TimePointManager interface + AddTimestamp func(key string, timePoint TimePoint, timestamp time.Time, extraInfos ...Info) + GetInfo func(key string) (Info, bool) + GetStatusCount func(status Status) int64 + GetStatusTime func(key string, status Status) (time.Duration, bool) + GetTimestamp func(key string, timePoint TimePoint) (time.Time, bool) + GetTimestampsCache func() map[string]Timestamps + var Job TimePointManager + func NewJobMetricTimePointManager() TimePointManager + type Timestamps interface + AddTimestamp func(timePoint TimePoint, timestamp time.Time) + GetStatusTime func(status Status) (time.Duration, bool) + GetTimestamp func(timePoint TimePoint) (time.Time, bool)