Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.0.0b69 (unreleased)

### Fixed

- The Slow Queries tab's empty-state message now shows the actually-configured
threshold (via `manage_get_slow_query_threshold()`) instead of hard-coding the
`PGCATALOG_SLOW_QUERY_MS` default of 10 ms.

## 1.0.0b68 (2026-06-30)

### Removed
Expand Down
5 changes: 3 additions & 2 deletions src/plone/pgcatalog/www/catalogSlowQueries.dtml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@
<dtml-else>
<p class="text-muted p-3 mb-0">
No slow queries recorded yet.
Queries exceeding the threshold (<code>PGCATALOG_SLOW_QUERY_MS</code>,
default 10ms) are logged here automatically.
Queries exceeding the configured threshold
(<code><dtml-var "manage_get_slow_query_threshold()">ms</code>, set via
<code>PGCATALOG_SLOW_QUERY_MS</code>) are logged here automatically.
</p>
</dtml-if>
</div>
Expand Down
27 changes: 27 additions & 0 deletions tests/test_slow_queries_view.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""The Slow Queries empty-state shows the configured threshold, not the default.

The "no slow queries yet" message used to hard-code the env var name and its
`default 10ms`; it now surfaces the actually-configured threshold via
`manage_get_slow_query_threshold()`.
"""

import pathlib


_DTML = (
pathlib.Path(__file__).parent.parent
/ "src"
/ "plone"
/ "pgcatalog"
/ "www"
/ "catalogSlowQueries.dtml"
)


def test_empty_state_uses_configured_threshold():
text = _DTML.read_text()
empty_state = text.split("No slow queries recorded yet.", 1)[1]
# Shows the actual value via the view method ...
assert "manage_get_slow_query_threshold()" in empty_state
# ... and no longer hard-codes the default.
assert "default 10ms" not in empty_state