mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
* Add support packet DB diagnostics for pool and pg_stat
Co-authored-by: Ben Schumacher <hanzei@users.noreply.github.com>
* Fix support packet mock store for new DB diagnostics
Co-authored-by: Ben Schumacher <hanzei@users.noreply.github.com>
* Add context timeouts to support packet pg diagnostics
Co-authored-by: Ben Schumacher <hanzei@users.noreply.github.com>
* Move support packet DB diagnostics queries into sqlstore
Co-authored-by: Ben Schumacher <hanzei@users.noreply.github.com>
* Fix support packet diagnostics lint and partial data handling
Co-authored-by: Ben Schumacher <hanzei@users.noreply.github.com>
* Stabilize support packet pool idle assertion
Co-authored-by: Ben Schumacher <hanzei@users.noreply.github.com>
* Relax live support packet DB counter assertions
Co-authored-by: Ben Schumacher <hanzei@users.noreply.github.com>
* Fix deterministic pool diagnostics test wiring
Co-authored-by: Ben Schumacher <hanzei@users.noreply.github.com>
* Mock support packet diagnostics in app test store
Co-authored-by: Ben Schumacher <hanzei@users.noreply.github.com>
* Move SupportPacketDatabaseDiagnostics out of public model
The struct is an internal store→platform transport (no yaml tags, never
serialized directly) so it doesn't belong in server/public/model where
it would form a public API contract for plugins. Move it into the store
package as the natural return type of GetSupportPacketDatabaseDiagnostics.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Describe SupportPacketDatabaseDiagnostics by content, not history
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* wording
* Align store diagnostics with sqlstore conventions
- Rename Store.GetSupportPacketDatabaseDiagnostics to Store.GetDiagnostics
and rename the holding files to diagnostics{,_test}.go.
- Drop the queryRowScanner / rowScanner / sqlQueryRowScanner test seam.
The collectors now use the sqlxDBWrapper master handle and bind result
rows into local structs via sqlx GetContext, matching how the rest of
the sqlstore package talks to Postgres.
- Replace the hand-rolled mock-based unit tests for the Postgres
collector with an integration test driven through StoreTest, the
pattern used by the other sqlstore tests (e.g. schema_dump_test.go).
The pure pool-stats unit test (TestApplyDBPoolStats) is kept.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Drop MasterDBStats/ReplicaDBStats from the Store interface
After GetDiagnostics moved into the store layer, no caller outside the
sqlstore package itself reads MasterDBStats/ReplicaDBStats through the
Store interface — the diagnostics collector calls them on the concrete
*SqlStore receiver. Remove them from the interface, the retry/timer
layer wrappers, the storetest fake, and the generated mock; drop the
now-redundant fixedDBStatsStore shim methods and mock setups in the
support packet tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Rename SupportPacketDatabaseDiagnostics to DatabaseDiagnostics
Now that the type lives in the store package and is returned by
Store.GetDiagnostics, the SupportPacket prefix is just legacy framing —
support packets are one consumer of the data, not its identity. Rename
to store.DatabaseDiagnostics for consistency with the package and method
name.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Inline diagnostics SQL into the collector functions
Each pg_stat query has a single caller, so a package-level constant just
adds indirection between the function and the SQL it owns. Move the
query strings to local consts inside the collectors that use them.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Fix Connectios typo to Connections
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Fix sqlstore diagnostics build: call GetMaster().DB() method
The recent rebase brought in a change that turned the SqlStore DB
field into a method, so passing ss.GetMaster().DB to
collectPostgresDatabaseDiagnostics (which expects *sqlx.DB) no longer
compiles. Call the method instead.
* Fix gofmt alignment in SupportPacketDiagnostics
The post-merge struct had extra spaces on MasterConnections /
ReplicaConnections that broke gofmt alignment.
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ben Schumacher <hanzei@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| mocks | ||
| .mockery.yaml | ||
| busy.go | ||
| busy_test.go | ||
| cluster.go | ||
| cluster_discovery.go | ||
| cluster_discovery_test.go | ||
| cluster_handlers.go | ||
| cluster_handlers_revoke_test.go | ||
| cluster_handlers_test.go | ||
| cluster_test.go | ||
| config.go | ||
| config_test.go | ||
| container_limits_linux.go | ||
| container_limits_linux_test.go | ||
| container_limits_other.go | ||
| disk_darwin.go | ||
| disk_linux.go | ||
| disk_other.go | ||
| enterprise.go | ||
| errors.go | ||
| fd_darwin.go | ||
| fd_linux.go | ||
| fd_other.go | ||
| fd_test.go | ||
| feature_flags.go | ||
| goroutines.go | ||
| helper_test.go | ||
| license.go | ||
| license_test.go | ||
| link_cache.go | ||
| log.go | ||
| log_test.go | ||
| main_test.go | ||
| memory_darwin.go | ||
| memory_linux.go | ||
| memory_other.go | ||
| metrics.go | ||
| metrics_test.go | ||
| options.go | ||
| search_backfill.go | ||
| search_backfill_test.go | ||
| searchengine.go | ||
| searchengine_test.go | ||
| searchengine_watcher.go | ||
| service.go | ||
| service_test.go | ||
| session.go | ||
| session_test.go | ||
| shared_channel_notifier.go | ||
| shared_channel_notifier_test.go | ||
| shared_channel_service_iface.go | ||
| status.go | ||
| status_test.go | ||
| support_packet.go | ||
| support_packet_test.go | ||
| uptime_darwin.go | ||
| uptime_darwin_test.go | ||
| uptime_linux.go | ||
| uptime_linux_test.go | ||
| uptime_other.go | ||
| uptime_other_test.go | ||
| utils.go | ||
| web_broadcast_hook.go | ||
| web_broadcast_hook_test.go | ||
| web_conn.go | ||
| web_conn_test.go | ||
| web_hub.go | ||
| web_hub_test.go | ||
| websocket_reliable.go | ||
| websocket_reliable_test.go | ||
| websocket_router.go | ||