mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 16:33:08 +00:00
fix: apply latest nph formating (#3334)
This commit is contained in:
parent
3e3af6d40e
commit
77105a6c2e
@ -10,7 +10,7 @@ import
|
|||||||
waku_core,
|
waku_core,
|
||||||
waku_core/message/digest,
|
waku_core/message/digest,
|
||||||
waku_archive/driver/sqlite_driver,
|
waku_archive/driver/sqlite_driver,
|
||||||
waku_archive
|
waku_archive,
|
||||||
],
|
],
|
||||||
../waku_archive/archive_utils,
|
../waku_archive/archive_utils,
|
||||||
../testlib/wakucore
|
../testlib/wakucore
|
||||||
@ -113,15 +113,18 @@ suite "Waku Archive - message handling":
|
|||||||
test "convert query to label":
|
test "convert query to label":
|
||||||
check:
|
check:
|
||||||
convertQueryToMetricLabel("SELECT version();") == "select_version"
|
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(
|
||||||
convertQueryToMetricLabel(""" SELECT child.relname AS partition_name
|
"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
|
FROM pg_inherits
|
||||||
JOIN pg_class parent ON pg_inherits.inhparent = parent.oid
|
JOIN pg_class parent ON pg_inherits.inhparent = parent.oid
|
||||||
JOIN pg_class child ON pg_inherits.inhrelid = child.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_parent ON nmsp_parent.oid = parent.relnamespace
|
||||||
JOIN pg_namespace nmsp_child ON nmsp_child.oid = child.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":
|
procSuite "Waku Archive - find messages":
|
||||||
## Fixtures
|
## Fixtures
|
||||||
|
|||||||
@ -7,25 +7,27 @@ declarePublicCounter query_count,
|
|||||||
"number of times a query is being performed", labels = ["query"]
|
"number of times a query is being performed", labels = ["query"]
|
||||||
|
|
||||||
## Maps parts of the possible known queries with a fixed and shorter query label.
|
## 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",
|
"contentTopic IN": "content_topic",
|
||||||
"WITH min_timestamp": "messages_lookup",
|
"SELECT version()": "select_version",
|
||||||
"SELECT messageHash FROM messages WHERE pubsubTopic = ? AND timestamp >= ? AND timestamp <= ? ORDER BY timestamp DESC, messageHash DESC LIMIT ?":
|
"WITH min_timestamp": "messages_lookup",
|
||||||
"msg_hash_no_ctopic",
|
"SELECT messageHash FROM messages WHERE pubsubTopic = ? AND timestamp >= ? AND timestamp <= ? ORDER BY timestamp DESC, messageHash DESC LIMIT ?":
|
||||||
"AS partition_name": "get_partitions_list",
|
"msg_hash_no_ctopic",
|
||||||
"SELECT COUNT(1) FROM messages": "count_msgs",
|
"AS partition_name": "get_partitions_list",
|
||||||
"SELECT messageHash FROM messages WHERE (timestamp, messageHash) < (?,?) AND pubsubTopic = ? AND timestamp >= ? AND timestamp <= ? ORDER BY timestamp DESC, messageHash DESC LIMIT ?":
|
"SELECT COUNT(1) FROM messages": "count_msgs",
|
||||||
"msg_hash_with_cursor",
|
"SELECT messageHash FROM messages WHERE (timestamp, messageHash) < (?,?) AND pubsubTopic = ? AND timestamp >= ? AND timestamp <= ? ORDER BY timestamp DESC, messageHash DESC LIMIT ?":
|
||||||
"SELECT pg_database_size(current_database())": "get_database_size",
|
"msg_hash_with_cursor",
|
||||||
"DELETE FROM messages_lookup WHERE timestamp": "delete_from_msgs_lookup",
|
"SELECT pg_database_size(current_database())": "get_database_size",
|
||||||
"DROP TABLE messages_": "drop_partition_table",
|
"DELETE FROM messages_lookup WHERE timestamp": "delete_from_msgs_lookup",
|
||||||
"ALTER TABLE messages DETACH PARTITION": "detach_partition",
|
"DROP TABLE messages_": "drop_partition_table",
|
||||||
"SELECT pg_size_pretty(pg_total_relation_size(C.oid))": "get_partition_size",
|
"ALTER TABLE messages DETACH PARTITION": "detach_partition",
|
||||||
"pg_try_advisory_lock": "try_advisory_lock",
|
"SELECT pg_size_pretty(pg_total_relation_size(C.oid))": "get_partition_size",
|
||||||
"SELECT messageHash FROM messages ORDER BY timestamp DESC, messageHash DESC LIMIT ?":
|
"pg_try_advisory_lock": "try_advisory_lock",
|
||||||
"get_all_msg_hash",
|
"SELECT messageHash FROM messages ORDER BY timestamp DESC, messageHash DESC LIMIT ?":
|
||||||
"SELECT pg_advisory_unlock": "advisory_unlock",
|
"get_all_msg_hash",
|
||||||
"ANALYZE messages": "analyze_messages",
|
"SELECT pg_advisory_unlock": "advisory_unlock",
|
||||||
"SELECT EXISTS": "check_version_table_exists",
|
"ANALYZE messages": "analyze_messages",
|
||||||
})
|
"SELECT EXISTS": "check_version_table_exists",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|||||||
@ -479,7 +479,7 @@ proc mount(
|
|||||||
rlnMaxEpochGap: max(uint64(MaxClockGapSeconds / float64(conf.rlnEpochSizeSec)), 1),
|
rlnMaxEpochGap: max(uint64(MaxClockGapSeconds / float64(conf.rlnEpochSizeSec)), 1),
|
||||||
onFatalErrorAction: conf.onFatalErrorAction,
|
onFatalErrorAction: conf.onFatalErrorAction,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Start epoch monitoring in the background
|
# Start epoch monitoring in the background
|
||||||
wakuRlnRelay.epochMonitorFuture = monitorEpochs(wakuRlnRelay)
|
wakuRlnRelay.epochMonitorFuture = monitorEpochs(wakuRlnRelay)
|
||||||
return ok(wakuRlnRelay)
|
return ok(wakuRlnRelay)
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
{.push raises: [].}
|
{.push raises: [].}
|
||||||
|
|
||||||
import
|
import
|
||||||
./waku_store_sync/reconciliation,
|
./waku_store_sync/reconciliation, ./waku_store_sync/transfer, ./waku_store_sync/common
|
||||||
./waku_store_sync/transfer,
|
|
||||||
./waku_store_sync/common
|
|
||||||
|
|
||||||
export reconciliation, transfer, common
|
export reconciliation, transfer, common
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user