@@ -21,6 +21,7 @@ import (
21
21
"math"
22
22
"path/filepath"
23
23
"strconv"
24
+ "strings"
24
25
"sync"
25
26
"time"
26
27
@@ -64,6 +65,7 @@ var tmoPolicyFuncs sync.Map
64
65
var tmoBlockFuncs sync.Map
65
66
66
67
type TmoStats struct {
68
+ obj string
67
69
memUsage float64
68
70
memInactive float64
69
71
memPsiAvg60 float64
@@ -109,7 +111,7 @@ func refaultPolicyFunc(lastStats TmoStats, currStats TmoStats, conf *tmoconf.TMO
109
111
// which means reclaim accuracy and reclaim scan efficiency is low.
110
112
result = math .Min (math .Max (lastStats .offloadingTargetSize * OffloadingSizeScaleCoeff , currStats .memInactive * InactiveProbe ), currStats .memUsage * conf .RefaultPolicyConf .MaxProbe )
111
113
}
112
- general .InfoS ("refault info" , "reclaimAccuracyRatio" , reclaimAccuracyRatio , "ReclaimAccuracyTarget" , conf .RefaultPolicyConf .ReclaimAccuracyTarget ,
114
+ general .InfoS ("refault info" , "obj" , currStats . obj , " reclaimAccuracyRatio" , reclaimAccuracyRatio , "ReclaimAccuracyTarget" , conf .RefaultPolicyConf .ReclaimAccuracyTarget ,
113
115
"reclaimScanEfficiencyRatio" , reclaimScanEfficiencyRatio , "ReclaimScanEfficiencyTarget" , conf .RefaultPolicyConf .ReclaimScanEfficiencyTarget ,
114
116
"refaultDelta" , refaultDelta , "pgstealDelta" , pgstealDelta , "pgscanDelta" , pgscanDelta , "lastOffloadingTargetSize" , general .FormatMemoryQuantity (lastStats .offloadingTargetSize ),
115
117
"result" , general .FormatMemoryQuantity (result ))
@@ -287,8 +289,10 @@ func (tmoEngine *tmoEngineInstance) getStats() (TmoStats, error) {
287
289
288
290
if tmoEngine .containerInfo == nil {
289
291
err = getCgroupMetrics (tmoEngine .metaServer , tmoEngine .cgpath )
292
+ tmoStats .obj = tmoEngine .cgpath
290
293
} else {
291
294
err = getContainerMetrics (tmoEngine .metaServer , tmoEngine .containerInfo .PodUID , tmoEngine .containerInfo .ContainerName )
295
+ tmoStats .obj = strings .Join ([]string {tmoEngine .containerInfo .PodNamespace , tmoEngine .containerInfo .PodName }, "/" )
292
296
}
293
297
return * tmoStats , err
294
298
}
0 commit comments