mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-24 17:56:29 +00:00
Fix maxwait metric (#183)
Max wait was being reported as 0 after #159 This PR fixes that and adds test
This commit is contained in:
committed by
GitHub
parent
7987c5ffad
commit
3d33ccf4b0
@@ -228,7 +228,13 @@ where
|
||||
pool_config.pool_mode.to_string(),
|
||||
];
|
||||
for column in &columns[3..columns.len()] {
|
||||
let value = pool_stats.get(column.0).unwrap_or(&0).to_string();
|
||||
let value = match column.0 {
|
||||
"maxwait" => (pool_stats.get("maxwait_us").unwrap_or(&0) / 1_000_000).to_string(),
|
||||
"maxwait_us" => {
|
||||
(pool_stats.get("maxwait_us").unwrap_or(&0) % 1_000_000).to_string()
|
||||
}
|
||||
_other_values => pool_stats.get(column.0).unwrap_or(&0).to_string(),
|
||||
};
|
||||
row.push(value);
|
||||
}
|
||||
res.put(data_row(&row));
|
||||
|
||||
Reference in New Issue
Block a user