Minor fix for some stats (#97)

This commit is contained in:
Pradeep Chhetri
2022-07-28 13:59:33 +08:00
committed by GitHub
parent 2ae4b438e3
commit 14d4dc45f5
2 changed files with 13 additions and 9 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.idea
/target /target
*.deb *.deb

View File

@@ -292,17 +292,18 @@ impl Collector {
let stats_template = HashMap::from([ let stats_template = HashMap::from([
("total_query_count", 0), ("total_query_count", 0),
("total_xact_count", 0),
("total_sent", 0),
("total_received", 0),
("total_xact_time", 0),
("total_query_time", 0), ("total_query_time", 0),
("total_received", 0),
("total_sent", 0),
("total_xact_count", 0),
("total_xact_time", 0),
("total_wait_time", 0), ("total_wait_time", 0),
("avg_xact_time", 0), ("avg_query_count", 0),
("avg_query_time", 0), ("avg_query_time", 0),
("avg_xact_count", 0),
("avg_sent", 0),
("avg_recv", 0), ("avg_recv", 0),
("avg_sent", 0),
("avg_xact_count", 0),
("avg_xact_time", 0),
("avg_wait_time", 0), ("avg_wait_time", 0),
("maxwait_us", 0), ("maxwait_us", 0),
("maxwait", 0), ("maxwait", 0),
@@ -506,9 +507,11 @@ impl Collector {
// Calculate averages // Calculate averages
for stat in &[ for stat in &[
"avg_query_count", "avg_query_count",
"avgxact_count", "avg_query_time",
"avg_sent",
"avg_recv", "avg_recv",
"avg_sent",
"avg_xact_time",
"avg_xact_count",
"avg_wait_time", "avg_wait_time",
] { ] {
let total_name = match stat { let total_name = match stat {