2017-08-16 23:37:37 +02:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
2020-08-10 00:29:54 +02:00
|
|
|
// See LICENSE.txt for license information.
|
2017-01-16 23:59:50 +01:00
|
|
|
|
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ClusterStats struct {
|
|
|
|
Id string `json:"id"`
|
|
|
|
TotalWebsocketConnections int `json:"total_websocket_connections"`
|
|
|
|
TotalReadDbConnections int `json:"total_read_db_connections"`
|
|
|
|
TotalMasterDbConnections int `json:"total_master_db_connections"`
|
|
|
|
}
|
|
|
|
|
2021-10-17 00:47:22 +02:00
|
|
|
func (cs *ClusterStats) ToJson() string {
|
|
|
|
b, _ := json.Marshal(cs)
|
2018-11-18 18:55:05 +01:00
|
|
|
return string(b)
|
2017-01-16 23:59:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func ClusterStatsFromJson(data io.Reader) *ClusterStats {
|
2021-10-17 00:47:22 +02:00
|
|
|
var cs *ClusterStats
|
|
|
|
json.NewDecoder(data).Decode(&cs)
|
|
|
|
return cs
|
2017-01-16 23:59:50 +01:00
|
|
|
}
|