[MM-23882] Include database server version in telemetry (#14258)

* Add database server version to telemetry

Also added a new query in the store to retrieve the database version

* Add test for the GetDbVersion function

* More drivers in the tests

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Mario de Frutos Dieguez
2020-04-09 11:08:15 +02:00
коммит произвёл GitHub
родитель f6f025aeaa
Коммит 698b4b6934
8 изменённых файлов: 132 добавлений и 37 удалений

Просмотреть файл

@@ -379,6 +379,27 @@ func (_m *SqlStore) GetCurrentSchemaVersion() string {
return r0
}
// GetDbVersion provides a mock function with given fields:
func (_m *SqlStore) GetDbVersion() (string, error) {
ret := _m.Called()
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetMaster provides a mock function with given fields:
func (_m *SqlStore) GetMaster() *gorp.DbMap {
ret := _m.Called()

Просмотреть файл

@@ -232,6 +232,27 @@ func (_m *Store) GetCurrentSchemaVersion() string {
return r0
}
// GetDbVersion provides a mock function with given fields:
func (_m *Store) GetDbVersion() (string, error) {
ret := _m.Called()
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Group provides a mock function with given fields:
func (_m *Store) Group() store.GroupStore {
ret := _m.Called()

Просмотреть файл

@@ -87,6 +87,7 @@ func (s *Store) Close() { /* do nothing */ }
func (s *Store) LockToMaster() { /* do nothing */ }
func (s *Store) UnlockFromMaster() { /* do nothing */ }
func (s *Store) DropAllTables() { /* do nothing */ }
func (s *Store) GetDbVersion() (string, error) { return "", nil }
func (s *Store) TotalMasterDbConnections() int { return 1 }
func (s *Store) TotalReadDbConnections() int { return 1 }
func (s *Store) TotalSearchDbConnections() int { return 1 }