Skip to content

Commit

Permalink
Make ruff happy
Browse files Browse the repository at this point in the history
PR sacrifice on the alter of the linting gods
  • Loading branch information
marco44 authored and rjuju committed Feb 7, 2025
1 parent 9ae3701 commit 55e8b54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
10 changes: 3 additions & 7 deletions powa/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ class QueryOverviewMetricGroup(MetricGroupDef):
local_blks_read = MetricDef(
label="Local read",
type="sizerate",
desc="Amount of local buffers found from OS"
" cache or read from disk",
desc="Amount of local buffers found from OS cache or read from disk",
)
local_blks_hit = MetricDef(
label="Local hit",
Expand Down Expand Up @@ -432,16 +431,13 @@ def query(self):
)
)
disk_hit_ratio = (
"sum(sub.reads) * 100 / "
"({total_blocks} * block_size)".format(
"sum(sub.reads) * 100 / ({total_blocks} * block_size)".format(
total_blocks=total_blocks
)
)
total_time = "greatest(sum(runtime), 1)"
other_time = (
"sum(runtime) - (("
"(sum(user_time) + sum(system_time))"
") * 1000)"
"sum(runtime) - (((sum(user_time) + sum(system_time))) * 1000)"
)

# Rusage can return values > real time due to sampling bias
Expand Down
13 changes: 5 additions & 8 deletions powa/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,9 @@ def query(self):
kcache_query = kcache_getstatdata_sample("db")

total_sys_hit = (
"{total_read} - sum(sub.reads)"
"/ {ts}"
" AS total_sys_hit"
"".format(total_read=total_read("sub", True), ts=get_ts())
"{total_read} - sum(sub.reads)/ {ts} AS total_sys_hit".format(
total_read=total_read("sub", True), ts=get_ts()
)
)
total_disk_read = (
"sum(sub.reads) / " + get_ts() + " AS total_disk_read"
Expand Down Expand Up @@ -1068,8 +1067,7 @@ class GlobalSubMetricGroup(MetricGroupDef):
apply_error_count = MetricDef(
label="# apply error",
type="number",
desc="Total number of times an error"
" occurred while applying changes",
desc="Total number of times an error occurred while applying changes",
)
sync_error_count = MetricDef(
label="# sync error",
Expand Down Expand Up @@ -1239,8 +1237,7 @@ class GlobalWalReceiverMetricGroup(MetricGroupDef):
flush_delta = MetricDef(
label="Flush delta",
type="size",
desc="Total amount of data received and written"
" but not flushed yet",
desc="Total amount of data received and written but not flushed yet",
)
last_msg_lag = MetricDef(
label="Last message latency",
Expand Down

0 comments on commit 55e8b54

Please sign in to comment.