fix: apply latest nph formating (#3334)

This commit is contained in:
Simon-Pierre Vivier 2025-03-19 11:30:47 -04:00 committed by GitHub
parent e2329f97e5
commit 7dbc1fe061
4 changed files with 34 additions and 31 deletions

View File

@ -10,7 +10,7 @@ import
waku_core,
waku_core/message/digest,
waku_archive/driver/sqlite_driver,
waku_archive
waku_archive,
],
../waku_archive/archive_utils,
../testlib/wakucore
@ -113,15 +113,18 @@ suite "Waku Archive - message handling":
test "convert query to label":
check:
convertQueryToMetricLabel("SELECT version();") == "select_version"
convertQueryToMetricLabel("SELECT messageHash FROM messages WHERE pubsubTopic = ? AND timestamp >= ? AND timestamp <= ? ORDER BY timestamp DESC, messageHash DESC LIMIT ?") == "msg_hash_no_ctopic"
convertQueryToMetricLabel(""" SELECT child.relname AS partition_name
convertQueryToMetricLabel(
"SELECT messageHash FROM messages WHERE pubsubTopic = ? AND timestamp >= ? AND timestamp <= ? ORDER BY timestamp DESC, messageHash DESC LIMIT ?"
) == "msg_hash_no_ctopic"
convertQueryToMetricLabel(
""" SELECT child.relname AS partition_name
FROM pg_inherits
JOIN pg_class parent ON pg_inherits.inhparent = parent.oid
JOIN pg_class child ON pg_inherits.inhrelid = child.oid
JOIN pg_namespace nmsp_parent ON nmsp_parent.oid = parent.relnamespace
JOIN pg_namespace nmsp_child ON nmsp_child.oid = child.relnamespace
WHERE parent.relname='messages""") == "get_partitions_list"
WHERE parent.relname='messages"""
) == "get_partitions_list"
procSuite "Waku Archive - find messages":
## Fixtures

View File

@ -7,7 +7,8 @@ declarePublicCounter query_count,
"number of times a query is being performed", labels = ["query"]
## Maps parts of the possible known queries with a fixed and shorter query label.
const QueriesToMetricMap* = toTable({
const QueriesToMetricMap* = toTable(
{
"contentTopic IN": "content_topic",
"SELECT version()": "select_version",
"WITH min_timestamp": "messages_lookup",
@ -28,4 +29,5 @@ const QueriesToMetricMap* = toTable({
"SELECT pg_advisory_unlock": "advisory_unlock",
"ANALYZE messages": "analyze_messages",
"SELECT EXISTS": "check_version_table_exists",
})
}
)

View File

@ -1,8 +1,6 @@
{.push raises: [].}
import
./waku_store_sync/reconciliation,
./waku_store_sync/transfer,
./waku_store_sync/common
./waku_store_sync/reconciliation, ./waku_store_sync/transfer, ./waku_store_sync/common
export reconciliation, transfer, common