mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: paused and evicted container stats (#1209)
* fn: paused and evicted container stats With this change, now stats reports paused state as well as incidents of container exit due to evictions. * fn: update/document state transitions in state tracker There's no case of a transition moving from done to waiting. This must be deprecated behavior.
This commit is contained in:
@@ -163,6 +163,7 @@ func (a *slotQueue) isIdle() bool {
|
||||
a.stats.containerStates[ContainerStateWait] == 0 &&
|
||||
a.stats.containerStates[ContainerStateStart] == 0 &&
|
||||
a.stats.containerStates[ContainerStateIdle] == 0 &&
|
||||
a.stats.containerStates[ContainerStatePaused] == 0 &&
|
||||
a.stats.containerStates[ContainerStateBusy] == 0
|
||||
|
||||
a.statsLock.Unlock()
|
||||
@@ -180,7 +181,7 @@ func (a *slotQueue) getStats() slotQueueStats {
|
||||
|
||||
func isNewContainerNeeded(cur *slotQueueStats) bool {
|
||||
|
||||
idleWorkers := cur.containerStates[ContainerStateIdle]
|
||||
idleWorkers := cur.containerStates[ContainerStateIdle] + cur.containerStates[ContainerStatePaused]
|
||||
starters := cur.containerStates[ContainerStateStart]
|
||||
startWaiters := cur.containerStates[ContainerStateWait]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user