metrics: add total_inactive_file metric for memory
Signed-off-by: Li Feng <lifeng2221dd1@zoho.com.cn>
This commit is contained in:
parent
e9fc51e660
commit
89bd000fc7
39
0019-metrics-add-total_inactive_file-metric-for-memory.patch
Normal file
39
0019-metrics-add-total_inactive_file-metric-for-memory.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
From 15da6e1f057c70eee476730138788fd73de1b208 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Li Feng <lifeng2221dd1@zoho.com.cn>
|
||||||
|
Date: Thu, 28 Jan 2021 16:05:18 +0800
|
||||||
|
Subject: [PATCH 19/19] metrics: add total_inactive_file metric for memory
|
||||||
|
|
||||||
|
Signed-off-by: Li Feng <lifeng2221dd1@zoho.com.cn>
|
||||||
|
---
|
||||||
|
src/lxc/lxccontainer.c | 1 +
|
||||||
|
src/lxc/lxccontainer.h | 2 ++
|
||||||
|
2 files changed, 3 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
|
||||||
|
index 9202b73ff..06552ce5c 100644
|
||||||
|
--- a/src/lxc/lxccontainer.c
|
||||||
|
+++ b/src/lxc/lxccontainer.c
|
||||||
|
@@ -5919,6 +5919,7 @@ static bool do_lxcapi_get_container_metrics(struct lxc_container *c, struct lxc
|
||||||
|
|
||||||
|
metrics->cache = metrics_match_get_ull(c, cgroup_ops, "memory.stat", "cache", 1);
|
||||||
|
metrics->cache_total = metrics_match_get_ull(c, cgroup_ops, "memory.stat", "total_cache", 1);
|
||||||
|
+ metrics->inactive_file_total = metrics_match_get_ull(c, cgroup_ops, "memory.stat", "total_inactive_file", 1);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h
|
||||||
|
index e30bf6161..9abbd09ed 100644
|
||||||
|
--- a/src/lxc/lxccontainer.h
|
||||||
|
+++ b/src/lxc/lxccontainer.h
|
||||||
|
@@ -69,6 +69,8 @@ struct lxc_container_metrics {
|
||||||
|
/* Cache usage */
|
||||||
|
uint64_t cache;
|
||||||
|
uint64_t cache_total;
|
||||||
|
+ /* total inactive file */
|
||||||
|
+ uint64_t inactive_file_total;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*!
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
||||||
9
lxc.spec
9
lxc.spec
@ -1,4 +1,4 @@
|
|||||||
%global _release 2021012001
|
%global _release 2021012801
|
||||||
|
|
||||||
Name: lxc
|
Name: lxc
|
||||||
Version: 4.0.3
|
Version: 4.0.3
|
||||||
@ -26,6 +26,7 @@ Patch0015: 0015-Streaming-IO-solution-optimization-and-enhancement.patch
|
|||||||
Patch0016: 0016-avoid-using-void-pointers-in-caclulation.patch
|
Patch0016: 0016-avoid-using-void-pointers-in-caclulation.patch
|
||||||
Patch0017: 0017-fix-compilation-errors-without-libcap.patch
|
Patch0017: 0017-fix-compilation-errors-without-libcap.patch
|
||||||
Patch0018: 0018-IO-fix-io-data-miss-when-exec-with-pipes.patch
|
Patch0018: 0018-IO-fix-io-data-miss-when-exec-with-pipes.patch
|
||||||
|
Patch0019: 0019-metrics-add-total_inactive_file-metric-for-memory.patch
|
||||||
|
|
||||||
BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath
|
BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath
|
||||||
BuildRequires: pkgconfig(libseccomp)
|
BuildRequires: pkgconfig(libseccomp)
|
||||||
@ -197,6 +198,12 @@ make check
|
|||||||
%{_mandir}/*/man7/%{name}*
|
%{_mandir}/*/man7/%{name}*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jan 28 2021 lifeng <lifeng68@huawei.com> - 4.0.3-2021012801
|
||||||
|
- Type:enhancement
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC: add inactive file total metrics
|
||||||
|
|
||||||
* Wed Jan 21 2021 lifeng <lifeng68@huawei.com> - 4.0.3-2021012001
|
* Wed Jan 21 2021 lifeng <lifeng68@huawei.com> - 4.0.3-2021012001
|
||||||
- Type:enhancement
|
- Type:enhancement
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
@ -16,3 +16,4 @@
|
|||||||
0016-avoid-using-void-pointers-in-caclulation.patch
|
0016-avoid-using-void-pointers-in-caclulation.patch
|
||||||
0017-fix-compilation-errors-without-libcap.patch
|
0017-fix-compilation-errors-without-libcap.patch
|
||||||
0018-IO-fix-io-data-miss-when-exec-with-pipes.patch
|
0018-IO-fix-io-data-miss-when-exec-with-pipes.patch
|
||||||
|
0019-metrics-add-total_inactive_file-metric-for-memory.patch
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user