MM-39215: Add DBStatsCollector to metrics (#21957)
https://mattermost.atlassian.net/browse/MM-39215 ```release-note We now have Grafana metrics for DB connection metrics. They are: max_open_connections open_connections in_use_connections idle_connections wait_count_total wait_duration_seconds_total max_idle_closed_total max_idle_time_closed_total max_lifetime_closed_total ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
74a20cbf7e
Коммит
a9bac806f3
@@ -4,12 +4,15 @@
|
||||
package einterfaces
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/model"
|
||||
"github.com/mattermost/mattermost-server/v6/shared/mlog"
|
||||
)
|
||||
|
||||
type MetricsInterface interface {
|
||||
Register()
|
||||
RegisterDBCollector(db *sql.DB, name string)
|
||||
|
||||
IncrementPostCreate()
|
||||
IncrementWebhookPost()
|
||||
|
||||
@@ -9,6 +9,8 @@ import (
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
model "github.com/mattermost/mattermost-server/v6/model"
|
||||
|
||||
sql "database/sql"
|
||||
)
|
||||
|
||||
// MetricsInterface is an autogenerated mock type for the MetricsInterface type
|
||||
@@ -302,6 +304,11 @@ func (_m *MetricsInterface) Register() {
|
||||
_m.Called()
|
||||
}
|
||||
|
||||
// RegisterDBCollector provides a mock function with given fields: db, name
|
||||
func (_m *MetricsInterface) RegisterDBCollector(db *sql.DB, name string) {
|
||||
_m.Called(db, name)
|
||||
}
|
||||
|
||||
// SetReplicaLagAbsolute provides a mock function with given fields: node, value
|
||||
func (_m *MetricsInterface) SetReplicaLagAbsolute(node string, value float64) {
|
||||
_m.Called(node, value)
|
||||
|
||||
Ссылка в новой задаче
Block a user