Skip to content

Commit f2a3198

Browse files
committed
Adding parsing.
1 parent 8031276 commit f2a3198

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

src/main/kotlin/docker/DockerProxy.kt

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,28 @@ abstract class DockerProxy(configuration: Configuration) : MigrationStrategy(con
9494
.command("docker", "stats", "--no-stream", "--no-trunc", "--format", "{{ json . }}")
9595
.redirectErrorStream(true)
9696
.start()
97-
process.inputReader().readLines().forEach { line ->
98-
println("Read line from docker stats: $line")
97+
98+
println("Reading docker stats")
99+
val reader = process.inputStream.bufferedReader()
100+
println("Reader $reader")
101+
reader.use {
102+
it.readAllLines().forEach { line ->
103+
println(line)
104+
}
105+
}
106+
println("Done reading")
107+
108+
/*
109+
val container = localContainers.computeIfAbsent(containerId) {
110+
DockerContainer(containerId, activeProcesses, CircularList(numberOfElements), CircularList(numberOfElements))
111+
}
112+
container.apply {
113+
cpuUsage.add(cpuPercentage)
114+
memoryUsage.add(memoryPercentage)
115+
updated = System.currentTimeMillis()
116+
processes = activeProcesses
99117
}
118+
*/
100119

101120
}
102121
}

0 commit comments

Comments
 (0)