-
Notifications
You must be signed in to change notification settings - Fork 962
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add volcano job completed and failed phase metric
Signed-off-by: Prepmachine4 <prepmachine4@gmail.com>
- Loading branch information
1 parent
320698e
commit 2ec9bb6
Showing
12 changed files
with
131 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package state | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
|
||
"volcano.sh/volcano/pkg/scheduler/metrics" | ||
) | ||
|
||
var ( | ||
jobCompletedPhaseCount = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Subsystem: metrics.VolcanoNamespace, | ||
Name: "job_completed_phase_count", | ||
Help: "Number of job completed phase", | ||
}, []string{"job_name", "queue_name"}, | ||
) | ||
|
||
jobFailedPhaseCount = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Subsystem: metrics.VolcanoNamespace, | ||
Name: "job_failed_phase_count", | ||
Help: "Number of job failed phase", | ||
}, []string{"job_name", "queue_name"}, | ||
) | ||
) | ||
|
||
func RegisterJobCompleted(jobName, queueName string) { | ||
jobCompletedPhaseCount.WithLabelValues(jobName, queueName).Inc() | ||
} | ||
|
||
func RegisterJobFailed(jobName, queueName string) { | ||
jobFailedPhaseCount.WithLabelValues(jobName, queueName).Inc() | ||
} | ||
|
||
func DeleteJobMetrics(jobName, queueName string) { | ||
jobCompletedPhaseCount.DeleteLabelValues(jobName, queueName) | ||
jobFailedPhaseCount.DeleteLabelValues(jobName, queueName) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters