Skip to content

Commit 89941e9

Browse files
Stephan Henrichsmjuraga
authored andcommitted
MEDIUM: runtime: Add glitch metrics to stick table fields
1 parent b286485 commit 89941e9

File tree

8 files changed

+63
-5
lines changed

8 files changed

+63
-5
lines changed

models/stick_table.go

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/stick_table_entry.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/stick_table_entry_compare.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

models/stick_table_entry_compare_test.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/stick_tables.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,16 @@ func parseStickTableEntry(output string) *models.StickTableEntry { //nolint:goco
238238
if err == nil {
239239
entry.BytesOutRate = &bytesOutRate
240240
}
241+
case key == "glitch_cnt":
242+
glitchCnt, err := strconv.ParseInt(strings.TrimSpace(v), 10, 64)
243+
if err == nil {
244+
entry.GlitchCnt = &glitchCnt
245+
}
246+
case strings.HasPrefix(key, "glitch_rate("):
247+
glitchRate, err := strconv.ParseInt(strings.TrimSpace(v), 10, 64)
248+
if err == nil {
249+
entry.GlitchRate = &glitchRate
250+
}
241251
case key == "use":
242252
entry.Use = strings.TrimSpace(v) == "1"
243253
case key == "exp":

specification/build/haproxy_spec.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9447,6 +9447,8 @@ definitions:
94479447
- server_id
94489448
- sess_cnt
94499449
- sess_rate
9450+
- glitch_rate
9451+
- glitch_cnt
94509452
type: string
94519453
period:
94529454
type: integer
@@ -9513,6 +9515,12 @@ definitions:
95139515
exp:
95149516
type: integer
95159517
x-nullable: true
9518+
glitch_cnt:
9519+
type: integer
9520+
x-nullable: true
9521+
glitch_rate:
9522+
type: integer
9523+
x-nullable: true
95169524
gpc0:
95179525
type: integer
95189526
x-nullable: true

specification/models/runtime/table.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ table:
4444
- server_id
4545
- sess_cnt
4646
- sess_rate
47+
- glitch_rate
48+
- glitch_cnt
4749
type:
4850
type: string
4951
enum: [rate, counter]

specification/models/runtime/table_entry.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,9 @@ table_entry:
7070
x-nullable: true
7171
use:
7272
type: boolean
73+
glitch_cnt:
74+
type: integer
75+
x-nullable: true
76+
glitch_rate:
77+
type: integer
78+
x-nullable: true

0 commit comments

Comments
 (0)