This repository has been archived by the owner on Sep 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add metrics to measure autoscaler performance and health
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package autoscale | ||
|
||
import "github.com/armon/go-metrics" | ||
|
||
// sendEvaluationErrorMetrics is a helper to track autoscaling evaluation errors. This is done by | ||
// tracking both overall errors, and job specific counters. | ||
func sendEvaluationErrorMetrics(job string) { | ||
metrics.IncrCounter([]string{"autoscale", "evaluation", "error"}, 1) | ||
metrics.IncrCounter([]string{"autoscale", job, "evaluation", "error"}, 1) | ||
} | ||
|
||
// sendTriggerErrorMetrics is a helper to track autoscaling scale trigger errors. This is done by | ||
// tracking both overall errors, and job specific counters. | ||
func sendTriggerErrorMetrics(job string) { | ||
metrics.IncrCounter([]string{"autoscale", "trigger", "error"}, 1) | ||
metrics.IncrCounter([]string{"autoscale", job, "trigger", "error"}, 1) | ||
} | ||
|
||
// sendTriggerSuccessMetrics is a helper to track autoscaling scale trigger success. This is done | ||
// by tracking both overall success, and job specific counters. | ||
func sendTriggerSuccessMetrics(job string) { | ||
metrics.IncrCounter([]string{"autoscale", "trigger", "success"}, 1) | ||
metrics.IncrCounter([]string{"autoscale", job, "trigger", "success"}, 1) | ||
} |