Record metrics for invocations when they start

* This experimental patch records metrics as invocations start
so that the metrics can be used to make better scale to zero
decisions in faas-idler.

Tested with Kubernetes on a single-node cluster, metrics
reported as expected. Existing metrics still report.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd)
2019-12-19 10:18:28 +00:00
committed by Alex Ellis
parent 1eea381dd5
commit 96812d2cd8
11 changed files with 51 additions and 22 deletions

View File

@ -84,6 +84,6 @@ type testNotifier struct {
}
// Notify about service metrics
func (tf *testNotifier) Notify(method string, URL string, originalURL string, statusCode int, duration time.Duration) {
func (tf *testNotifier) Notify(method string, URL string, originalURL string, statusCode int, event string, duration time.Duration) {
tf.StatusReceived = statusCode
}