diff --git a/models/native_stat_stats.go b/models/native_stat_stats.go index b89419d8..aea5e462 100644 --- a/models/native_stat_stats.go +++ b/models/native_stat_stats.go @@ -31,7 +31,7 @@ import ( ) // NativeStatStats native stat stats -// Example: {"bin":4326578,"bout":889901290,"comp_byp":0,"comp_in":0,"comp_out":0,"comp_rsp":0,"conn_rate":12,"conn_rate_max":456,"conn_tot":45682,"dcon":0,"dreq":4,"dresp":1,"dses":0,"ereq":54,"hrsp_1xx":0,"hrsp_2xx":165,"hrsp_3xx":12,"hrsp_4xx":50,"hrsp_5xx":4,"hrsp_other":0,"iid":0,"intercepted":346,"mode":"http","pid":3204,"rate":64,"rate_lim":20000,"rate_max":4000,"req_rate":49,"req_rate_max":3965,"req_total":1254786,"scur":129,"slim":2000,"smax":2000,"status":"UP","stot":12902} +// Example: {"bin":4326578,"bout":889901290,"comp_byp":0,"comp_in":0,"comp_out":0,"comp_rsp":0,"conn_rate":12,"conn_rate_max":456,"conn_tot":45682,"dcon":0,"dreq":4,"dresp":1,"dses":0,"ereq":54,"hrsp_1xx":0,"hrsp_2xx":165,"hrsp_3xx":12,"hrsp_4xx":50,"hrsp_5xx":4,"hrsp_other":0,"iid":0,"intercepted":346,"last_chk":"L4OK in 0ms","mode":"http","pid":3204,"rate":64,"rate_lim":20000,"rate_max":4000,"req_rate":49,"req_rate_max":3965,"req_total":1254786,"scur":129,"slim":2000,"smax":2000,"status":"UP","stot":12902} // // swagger:model native_stat_stats type NativeStatStats struct { @@ -187,6 +187,9 @@ type NativeStatStats struct { // intercepted Intercepted *int64 `json:"intercepted,omitempty"` + // last chk + LastChk *string `json:"last_chk,omitempty"` + // lastchg Lastchg *int64 `json:"lastchg,omitempty"` diff --git a/models/native_stat_stats_compare.go b/models/native_stat_stats_compare.go index fdfc0060..093e732f 100644 --- a/models/native_stat_stats_compare.go +++ b/models/native_stat_stats_compare.go @@ -220,6 +220,10 @@ func (s NativeStatStats) Equal(t NativeStatStats, opts ...Options) bool { return false } + if !equalPointers(s.LastChk, t.LastChk) { + return false + } + if !equalPointers(s.Lastchg, t.Lastchg) { return false } @@ -543,6 +547,10 @@ func (s NativeStatStats) Diff(t NativeStatStats, opts ...Options) map[string][]i diff["Intercepted"] = []interface{}{ValueOrNil(s.Intercepted), ValueOrNil(t.Intercepted)} } + if !equalPointers(s.LastChk, t.LastChk) { + diff["LastChk"] = []interface{}{ValueOrNil(s.LastChk), ValueOrNil(t.LastChk)} + } + if !equalPointers(s.Lastchg, t.Lastchg) { diff["Lastchg"] = []interface{}{ValueOrNil(s.Lastchg), ValueOrNil(t.Lastchg)} } diff --git a/models/native_stat_stats_compare_test.go b/models/native_stat_stats_compare_test.go index fa711f7c..82f16cbc 100644 --- a/models/native_stat_stats_compare_test.go +++ b/models/native_stat_stats_compare_test.go @@ -303,7 +303,7 @@ func TestNativeStatStatsDiffFalse(t *testing.T) { for _, sample := range samples { result := sample.a.Diff(sample.b) - if len(result) != 78 { + if len(result) != 79 { json := jsoniter.ConfigCompatibleWithStandardLibrary a, err := json.Marshal(&sample.a) if err != nil { @@ -313,7 +313,7 @@ func TestNativeStatStatsDiffFalse(t *testing.T) { if err != nil { t.Errorf(err.Error()) } - t.Errorf("Expected NativeStatStats to be different in 78 cases, but it is not (%d) %s %s", len(result), a, b) + t.Errorf("Expected NativeStatStats to be different in 79 cases, but it is not (%d) %s %s", len(result), a, b) } } } diff --git a/specification/build/haproxy_spec.yaml b/specification/build/haproxy_spec.yaml index 7f18f6f2..6f27febb 100644 --- a/specification/build/haproxy_spec.yaml +++ b/specification/build/haproxy_spec.yaml @@ -7188,6 +7188,7 @@ definitions: hrsp_other: 0 iid: 0 intercepted: 346 + last_chk: L4OK in 0ms mode: http pid: 3204 rate: 64 @@ -7471,6 +7472,11 @@ definitions: - frontend - backend x-nullable: true + last_chk: + type: string + x-dependency: + type: server + x-nullable: true lastchg: type: integer x-dependency: diff --git a/specification/models/stats.yaml b/specification/models/stats.yaml index c7faad47..00cd71af 100644 --- a/specification/models/stats.yaml +++ b/specification/models/stats.yaml @@ -384,6 +384,11 @@ native_stat_stats: x-nullable: true x-dependency: type: frontend + last_chk: + type: string + x-nullable: true + x-dependency: + type: server example: scur: 129 smax: 2000 @@ -420,3 +425,4 @@ native_stat_stats: intercepted: 346 dcon: 0 dses: 0 + last_chk: "L4OK in 0ms"