Skip to content

Commit 3a4e633

Browse files
committed
Looking for issues with buffering.
1 parent a44e0c9 commit 3a4e633

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/kotlin/docker/DockerProxy.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ abstract class DockerProxy(configuration: Configuration) : MigrationStrategy(con
105105
reader.readLines().forEach { line ->
106106
val stats = Json.decodeFromString<DockerStatsModel>(line)
107107
val pids = stats.pids.toIntOrNull() ?: 0
108-
val cpuPercentage = stats.cpuPercentage.replace("%", "").toDoubleOrNull() ?: 0.0
109-
val memoryPercentage = stats.memoryPercentage.replace("%", "").toDoubleOrNull() ?: 0.0
108+
val cpuPercentage = stats.cpuPercentage.trim('%').toDoubleOrNull() ?: 0.0
109+
val memoryPercentage = stats.memoryPercentage.trim('%').toDoubleOrNull() ?: 0.0
110110

111111
val container = localContainers.computeIfAbsent(stats.id) {
112112
DockerContainer(stats.id, pids, CircularList(numberOfElements), CircularList(numberOfElements))

0 commit comments

Comments
 (0)