From 4daa1572b9f129ba46cefb13683de90b49404872 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Tue, 18 Apr 2023 15:22:21 +0800
Subject: [PATCH] remove unused meminfo stats

Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
 src/lxc/lxccontainer.c | 10 ----------
 src/lxc/lxccontainer.h |  2 --
 2 files changed, 12 deletions(-)

diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index afbeb3c..cc6c5cd 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -6053,16 +6053,6 @@ static bool do_lxcapi_get_container_metrics(struct lxc_container *c,  struct lxc
 	metrics->cpu_use_nanos = metrics_get_ull(c, cgroup_ops, "cpuacct.usage");
 	metrics->pids_current = metrics_get_ull(c, cgroup_ops, "pids.current");
 
-	uint64_t usage_bytes; 
-	uint64_t workingset;
-	usage_bytes = metrics_match_get_ull(c,cgroup_ops, "memory.stat", "rss", 1) +  
-					    metrics_match_get_ull(c, cgroup_ops, "memory.stat", "cache", 1) + 
-					    metrics_match_get_ull(c, cgroup_ops, "memory.stat", "swap", 1);
-	// workingset = usage - inactive_file
-	workingset = usage_bytes - metrics_match_get_ull(c, cgroup_ops, "memory.stat", "total_inactive_file", 1);
-	// Avaliable bytes = limit - workingset 
-	metrics->avaliable_bytes = metrics_get_ull(c, cgroup_ops, "memory.limit_in_bytes") - workingset;
-	metrics->usage_bytes = usage_bytes;
 	metrics->rss_bytes = metrics_match_get_ull(c,cgroup_ops, "memory.stat", "rss", 1);
 	metrics->page_faults = metrics_match_get_ull(c,cgroup_ops, "memory.stat", "pgfault", 1);
 	metrics->major_page_faults = metrics_match_get_ull(c,cgroup_ops, "memory.stat", "pgmajfault", 1);
diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h
index 68dfec9..96db5e6 100644
--- a/src/lxc/lxccontainer.h
+++ b/src/lxc/lxccontainer.h
@@ -68,8 +68,6 @@ struct lxc_container_metrics {
     /* Memory usage */
     uint64_t mem_used;
     uint64_t mem_limit;
-    uint64_t avaliable_bytes;
-    uint64_t usage_bytes;
     uint64_t rss_bytes;
     uint64_t page_faults;
     uint64_t major_page_faults;
-- 
2.25.1

