PLT-4357 adding performance monitoring (#4622)
* WIP * WIP * Adding metrics collection * updating vendor packages * Adding metrics to config * Adding admin console page for perf monitoring * Updating glide * switching to tylerb/graceful
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
e033dcce8e
Коммит
7961599b2e
@@ -98,6 +98,11 @@ type ClusterSettings struct {
|
||||
InterNodeUrls []string
|
||||
}
|
||||
|
||||
type MetricsSettings struct {
|
||||
Enable *bool
|
||||
ListenAddress *string
|
||||
}
|
||||
|
||||
type SSOSettings struct {
|
||||
Enable bool
|
||||
Secret string
|
||||
@@ -330,6 +335,7 @@ type Config struct {
|
||||
SamlSettings SamlSettings
|
||||
NativeAppSettings NativeAppSettings
|
||||
ClusterSettings ClusterSettings
|
||||
MetricsSettings MetricsSettings
|
||||
WebrtcSettings WebrtcSettings
|
||||
}
|
||||
|
||||
@@ -772,6 +778,16 @@ func (o *Config) SetDefaults() {
|
||||
o.ClusterSettings.InterNodeUrls = []string{}
|
||||
}
|
||||
|
||||
if o.MetricsSettings.ListenAddress == nil {
|
||||
o.MetricsSettings.ListenAddress = new(string)
|
||||
*o.MetricsSettings.ListenAddress = ":8067"
|
||||
}
|
||||
|
||||
if o.MetricsSettings.Enable == nil {
|
||||
o.MetricsSettings.Enable = new(bool)
|
||||
*o.MetricsSettings.Enable = false
|
||||
}
|
||||
|
||||
if o.ComplianceSettings.Enable == nil {
|
||||
o.ComplianceSettings.Enable = new(bool)
|
||||
*o.ComplianceSettings.Enable = false
|
||||
|
||||
@@ -39,6 +39,7 @@ type Features struct {
|
||||
Office365OAuth *bool `json:"office365_oauth"`
|
||||
Compliance *bool `json:"compliance"`
|
||||
Cluster *bool `json:"cluster"`
|
||||
Metrics *bool `json:"metrics"`
|
||||
CustomBrand *bool `json:"custom_brand"`
|
||||
MHPNS *bool `json:"mhpns"`
|
||||
SAML *bool `json:"saml"`
|
||||
@@ -55,6 +56,7 @@ func (f *Features) ToMap() map[string]interface{} {
|
||||
"office365": *f.Office365OAuth,
|
||||
"compliance": *f.Compliance,
|
||||
"cluster": *f.Cluster,
|
||||
"metrics": *f.Metrics,
|
||||
"custom_brand": *f.CustomBrand,
|
||||
"mhpns": *f.MHPNS,
|
||||
"saml": *f.SAML,
|
||||
@@ -104,6 +106,11 @@ func (f *Features) SetDefaults() {
|
||||
*f.Cluster = *f.FutureFeatures
|
||||
}
|
||||
|
||||
if f.Metrics == nil {
|
||||
f.Metrics = new(bool)
|
||||
*f.Metrics = *f.FutureFeatures
|
||||
}
|
||||
|
||||
if f.CustomBrand == nil {
|
||||
f.CustomBrand = new(bool)
|
||||
*f.CustomBrand = *f.FutureFeatures
|
||||
|
||||
@@ -34,6 +34,7 @@ type WebSocketMessage interface {
|
||||
IsValid() bool
|
||||
DoPreComputeJson()
|
||||
GetPreComputeJson() []byte
|
||||
EventType() string
|
||||
}
|
||||
|
||||
type WebsocketBroadcast struct {
|
||||
@@ -63,6 +64,10 @@ func (o *WebSocketEvent) IsValid() bool {
|
||||
return o.Event != ""
|
||||
}
|
||||
|
||||
func (o *WebSocketEvent) EventType() string {
|
||||
return o.Event
|
||||
}
|
||||
|
||||
func (o *WebSocketEvent) DoPreComputeJson() {
|
||||
b, err := json.Marshal(o)
|
||||
if err != nil {
|
||||
@@ -120,6 +125,10 @@ func (o *WebSocketResponse) IsValid() bool {
|
||||
return o.Status != ""
|
||||
}
|
||||
|
||||
func (o *WebSocketResponse) EventType() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (o *WebSocketResponse) ToJson() string {
|
||||
b, err := json.Marshal(o)
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user