mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Add appname to basic metrics (#547)
* Add app labels to queued/running/completed/failed metrics * Add app labels to queued/running/completed/failed metrics * Add app labels to queued/running/completed/failed metrics
This commit is contained in:
committed by
Reed Allman
parent
778c8b0495
commit
954f69e74a
@@ -192,7 +192,7 @@ func (a *agent) Submit(callI Call) error {
|
||||
}
|
||||
|
||||
// increment queued count
|
||||
a.stats.Enqueue(callI.Model().Path)
|
||||
a.stats.Enqueue(callI.Model().AppName, callI.Model().Path)
|
||||
|
||||
call := callI.(*call)
|
||||
ctx := call.req.Context()
|
||||
@@ -209,7 +209,7 @@ func (a *agent) Submit(callI Call) error {
|
||||
|
||||
slot, err := a.getSlot(ctx, call) // find ram available / running
|
||||
if err != nil {
|
||||
a.stats.Dequeue(callI.Model().Path)
|
||||
a.stats.Dequeue(callI.Model().AppName, callI.Model().Path)
|
||||
return transformTimeout(err, true)
|
||||
}
|
||||
// TODO if the call times out & container is created, we need
|
||||
@@ -219,12 +219,12 @@ func (a *agent) Submit(callI Call) error {
|
||||
// TODO Start is checking the timer now, we could do it here, too.
|
||||
err = call.Start(ctx, a)
|
||||
if err != nil {
|
||||
a.stats.Dequeue(callI.Model().Path)
|
||||
a.stats.Dequeue(callI.Model().AppName, callI.Model().Path)
|
||||
return transformTimeout(err, true)
|
||||
}
|
||||
|
||||
// decrement queued count, increment running count
|
||||
a.stats.DequeueAndStart(callI.Model().Path)
|
||||
a.stats.DequeueAndStart(callI.Model().AppName, callI.Model().Path)
|
||||
|
||||
err = slot.exec(ctx, call)
|
||||
// pass this error (nil or otherwise) to end directly, to store status, etc
|
||||
@@ -232,10 +232,10 @@ func (a *agent) Submit(callI Call) error {
|
||||
|
||||
if err == nil {
|
||||
// decrement running count, increment completed count
|
||||
a.stats.Complete(callI.Model().Path)
|
||||
a.stats.Complete(callI.Model().AppName, callI.Model().Path)
|
||||
} else {
|
||||
// decrement running count, increment failed count
|
||||
a.stats.Failed(callI.Model().Path)
|
||||
a.stats.Failed(callI.Model().AppName, callI.Model().Path)
|
||||
}
|
||||
|
||||
// TODO: we need to allocate more time to store the call + logs in case the call timed out,
|
||||
|
||||
Reference in New Issue
Block a user