@@ -19,7 +19,6 @@ package org.apache.openwhisk.core.containerpool.v2
19
19
20
20
import java .util .concurrent .atomic .AtomicInteger
21
21
import akka .actor .{Actor , ActorRef , ActorRefFactory , Cancellable , Props }
22
-
23
22
import org .apache .openwhisk .common ._
24
23
import org .apache .openwhisk .core .connector .ContainerCreationError ._
25
24
import org .apache .openwhisk .core .connector .{
@@ -44,7 +43,7 @@ import org.apache.openwhisk.http.Messages
44
43
45
44
import scala .annotation .tailrec
46
45
import scala .collection .concurrent .TrieMap
47
- import scala .collection .immutable
46
+ import scala .collection .{ immutable , mutable }
48
47
import scala .concurrent .Future
49
48
import scala .concurrent .duration ._
50
49
import scala .util .{Random , Try }
@@ -116,10 +115,14 @@ class FunctionPullingContainerPool(
116
115
val prewarmedSize = prewarmedPool.size
117
116
val busySize = busyPool.size
118
117
val warmedSize = warmedPool.size
119
- val warmedPoolMap : Map [( String , String ), Int ] = warmedPool groupBy {
118
+ val warmedPoolGroupMap = warmedPool groupBy {
120
119
case (_, warmedData) => (warmedData.invocationNamespace, warmedData.action.toString)
121
- } mapValues (_.size)
122
- for ((data, size) <- warmedPoolMap) {
120
+ }
121
+ val warmedPoolResultMap : mutable.Map [(String , String ), Int ] = mutable.Map .empty[(String , String ), Int ]
122
+ warmedPoolGroupMap.foreach { data =>
123
+ warmedPoolResultMap += (data._1 -> data._2.size)
124
+ }
125
+ for ((data, size) <- warmedPoolResultMap) {
123
126
val tags : Option [Map [String , String ]] = Some (Map (" namespace" -> data._1, " action" -> data._2))
124
127
MetricEmitter .emitHistogramMetric(LoggingMarkers .INVOKER_CONTAINERPOOL_CONTAINER (" warmed" , tags), size)
125
128
}
0 commit comments