lcr/0002-lcr-add-inactive-file-total-metric.patch

54 lines
1.5 KiB
Diff
Raw Normal View History

From 7129e7bc07005452f1b965e206e56134c1119a04 Mon Sep 17 00:00:00 2001
From: Li Feng <lifeng2221dd1@zoho.com.cn>
Date: Thu, 28 Jan 2021 19:17:22 +0800
Subject: [PATCH 2/2] lcr: add inactive file total metric
Signed-off-by: Li Feng <lifeng2221dd1@zoho.com.cn>
---
src/json/schema/container/info.json | 3 +++
src/lcrcontainer.h | 1 +
src/lcrcontainer_execute.c | 1 +
3 files changed, 5 insertions(+)
diff --git a/src/json/schema/container/info.json b/src/json/schema/container/info.json
index e554556..8ce10af 100644
--- a/src/json/schema/container/info.json
+++ b/src/json/schema/container/info.json
@@ -55,6 +55,9 @@
},
"cache_total": {
"type": "uint64"
+ },
+ "inactive_file_total": {
+ "type": "uint64"
}
}
}
diff --git a/src/lcrcontainer.h b/src/lcrcontainer.h
index 68014ba..dcd1b12 100644
--- a/src/lcrcontainer.h
+++ b/src/lcrcontainer.h
@@ -98,6 +98,7 @@ struct lcr_container_state {
/* Cache usage */
uint64_t cache;
uint64_t cache_total;
+ uint64_t inactive_file_total;
};
typedef enum {
diff --git a/src/lcrcontainer_execute.c b/src/lcrcontainer_execute.c
index 2091b49..ab04c7e 100644
--- a/src/lcrcontainer_execute.c
+++ b/src/lcrcontainer_execute.c
@@ -500,6 +500,7 @@ void do_lcr_state(struct lxc_container *c, struct lcr_container_state *lcs)
lcs->cache = lxc_metrics.cache;
lcs->cache_total = lxc_metrics.cache_total;
+ lcs->inactive_file_total = lxc_metrics.inactive_file_total;
}
#define ExitSignalOffset 128
--
2.25.1