Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 71e4f9c

Browse files
committed
metrics: add memory used line plot to PDF, update description
1 parent 49dc519 commit 71e4f9c

2 files changed

Lines changed: 32 additions & 7 deletions

File tree

metrics/report/report_dockerfile/collectd_scaling.R

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ for (currentdir in resultdirs) {
430430
# It's nice to show the graphs in Gb, at least for any decent sized test
431431
# run, so make a new column with that pre-divided data in it for us to use.
432432
memfreedata$mem_free_gb = memfreedata$value/(1024*1024*1024)
433+
memuseddata$mem_used_gb = memuseddata$value/(1024*1024*1024)
433434
# And show the boot times in seconds, not ms
434435
podbootdata$launch_time_s = podbootdata$launch_time/1000.0
435436

@@ -440,8 +441,9 @@ mem_stats_plot = suppressWarnings(ggtexttable(data.frame(memstats),
440441
rows=NULL
441442
))
442443

443-
mem_scale = (max(memfreedata$value) / (1024*1024*1024)) / max(podbootdata$n_pods)
444-
mem_line_plot <- ggplot() +
444+
mem_free_scale = (max(memfreedata$value) / (1024*1024*1024)) / max(podbootdata$n_pods)
445+
mem_used_scale = (max(memuseddata$value) / (1024*1024*1024)) / max(podbootdata$n_pods)
446+
mem_free_line_plot <- ggplot() +
445447
geom_line(data=memfreedata,
446448
aes(s_offset, mem_free_gb, colour=interaction(testname, node),
447449
group=interaction(testname, node)),
@@ -451,20 +453,43 @@ mem_line_plot <- ggplot() +
451453
group=interaction(testname, node)),
452454
alpha=0.5, size=0.5) +
453455
geom_line(data=podbootdata,
454-
aes(x=s_offset, y=n_pods*mem_scale, colour=interaction(testname,"pod count"), group=testname),
456+
aes(x=s_offset, y=n_pods*mem_free_scale, colour=interaction(testname,"pod count"), group=testname),
455457
alpha=0.2) +
456458
geom_point(data=podbootdata,
457-
aes(x=s_offset, y=n_pods*mem_scale, colour=interaction(testname,"pod count"), group=testname),
459+
aes(x=s_offset, y=n_pods*mem_free_scale, colour=interaction(testname,"pod count"), group=testname),
458460
alpha=0.3, size=0.5) +
459461
labs(colour="") +
460462
xlab("seconds") +
461463
ylab("System Avail (Gb)") +
462-
scale_y_continuous(labels=comma, sec.axis=sec_axis(~ ./mem_scale, name="pods")) +
464+
scale_y_continuous(labels=comma, sec.axis=sec_axis(~ ./mem_free_scale, name="pods")) +
463465
ggtitle("System Memory free") +
464466
theme(axis.text.x=element_text(angle=90))
465467

468+
mem_used_line_plot <- ggplot() +
469+
geom_line(data=memuseddata,
470+
aes(s_offset, mem_used_gb, colour=interaction(testname, node),
471+
group=interaction(testname, node)),
472+
alpha=0.3) +
473+
geom_point(data=memuseddata,
474+
aes(s_offset, mem_used_gb, colour=interaction(testname, node),
475+
group=interaction(testname, node)),
476+
alpha=0.5, size=0.5) +
477+
geom_line(data=podbootdata,
478+
aes(x=s_offset, y=n_pods*mem_used_scale, colour=interaction(testname,"pod count"), group=testname),
479+
alpha=0.2) +
480+
geom_point(data=podbootdata,
481+
aes(x=s_offset, y=n_pods*mem_used_scale, colour=interaction(testname,"pod count"), group=testname),
482+
alpha=0.3, size=0.5) +
483+
labs(colour="") +
484+
xlab("seconds") +
485+
ylab("System Used (Gb)") +
486+
scale_y_continuous(labels=comma, sec.axis=sec_axis(~ ./mem_used_scale, name="pods")) +
487+
ggtitle("System Memory used, not counting Cached, Buffered and SLAB") +
488+
theme(axis.text.x=element_text(angle=90))
489+
466490
page1 = grid.arrange(
467-
mem_line_plot,
491+
mem_free_line_plot,
492+
mem_used_line_plot,
468493
mem_stats_plot,
469494
ncol=1
470495
)

metrics/report/report_dockerfile/metrics_report.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ source('parallel.R')
4040

4141
# Runtime scaling rapid
4242
This [test](https://github.com/clearlinux/cloud-native-setup/metrics/scaling/k8s_scale_fast.sh)
43-
uses collectd to asynchronously measure CPU idle %, free memory, pod boot time, free inodes,
43+
uses collectd to asynchronously measure CPU idle %, free and used memory, pod boot time, free inodes,
4444
and interface stats as it launches more and more idle `busybox` pods on a Kubernetes cluster.
4545

4646
> Note: CPU % is measured as a system whole - 100% represents *all* CPUs on the node.

0 commit comments

Comments
 (0)