Skip to content

Commit

Permalink
MEDIUM: runtime: Add glitch metrics to stick table fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Henrichs committed Jan 27, 2025
1 parent b286485 commit 6780ea6
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 5 deletions.
12 changes: 9 additions & 3 deletions models/stick_table.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions models/stick_table_entry.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions models/stick_table_entry_compare.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions models/stick_table_entry_compare_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions runtime/stick_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@ func parseStickTableEntry(output string) *models.StickTableEntry { //nolint:goco
if err == nil {
entry.BytesOutRate = &bytesOutRate
}
case key == "glitch_cnt":
glitchCnt, err := strconv.ParseInt(strings.TrimSpace(v), 10, 64)
if err == nil {
entry.GlitchCnt = &glitchCnt
}
case strings.HasPrefix(key, "glitch_rate("):
glitchRate, err := strconv.ParseInt(strings.TrimSpace(v), 10, 64)
if err == nil {
entry.GlitchRate = &glitchRate
}
case key == "use":
entry.Use = strings.TrimSpace(v) == "1"
case key == "exp":
Expand Down
8 changes: 8 additions & 0 deletions specification/build/haproxy_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9447,6 +9447,8 @@ definitions:
- server_id
- sess_cnt
- sess_rate
- glitch_rate
- glitch_cnt
type: string
period:
type: integer
Expand Down Expand Up @@ -9513,6 +9515,12 @@ definitions:
exp:
type: integer
x-nullable: true
glitch_cnt:
type: integer
x-nullable: true
glitch_rate:
type: integer
x-nullable: true
gpc0:
type: integer
x-nullable: true
Expand Down
2 changes: 2 additions & 0 deletions specification/models/runtime/table.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ table:
- server_id
- sess_cnt
- sess_rate
- glitch_rate
- glitch_cnt
type:
type: string
enum: [rate, counter]
Expand Down
6 changes: 6 additions & 0 deletions specification/models/runtime/table_entry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,9 @@ table_entry:
x-nullable: true
use:
type: boolean
glitch_cnt:
type: integer
x-nullable: true
glitch_rate:
type: integer
x-nullable: true

0 comments on commit 6780ea6

Please sign in to comment.