Skip to content

Commit

Permalink
feat(v2alpha2): add connections in status
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory-Z committed Jun 29, 2023
1 parent c3cbb6d commit ba93d93
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 2 deletions.
5 changes: 5 additions & 0 deletions apis/apps/v2alpha2/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ type EMQXNode struct {
Edition string `json:"edition,omitempty"`
// EMQX node uptime, milliseconds
Uptime int64 `json:"uptime,omitempty"`
// In EMQX's API of `/api/v5/nodes`, the `connections` field means the number of MQTT session count,
Session int64 `json:"connections,omitempty"`
// In EMQX's API of `/api/v5/nodes`, the `live_connections` field means the number of connected MQTT clients.
// THe `live_connections` just work in EMQX 5.1 or later.
Connections int64 `json:"live_connections,omitempty"`
}

const (
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/apps.emqx.io_emqxes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12877,8 +12877,14 @@ spec:
nodes:
items:
properties:
connections:
format: int64
type: integer
edition:
type: string
live_connections:
format: int64
type: integer
node:
type: string
node_status:
Expand Down Expand Up @@ -12911,8 +12917,14 @@ spec:
nodes:
items:
properties:
connections:
format: int64
type: integer
edition:
type: string
live_connections:
format: int64
type: integer
node:
type: string
node_status:
Expand Down
2 changes: 1 addition & 1 deletion config/samples/emqx/v2alpha1/emqx-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: EMQX
metadata:
name: emqx
spec:
image: "emqx:5.1"
image: "emqx:5.0"
imagePullPolicy: IfNotPresent
# imagePullSecrets:
# - name: fake-secrets
Expand Down
2 changes: 1 addition & 1 deletion config/samples/emqx/v2alpha1/emqx-slim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ kind: EMQX
metadata:
name: emqx
spec:
image: emqx:5.1
image: emqx:5.0
12 changes: 12 additions & 0 deletions deploy/charts/emqx-operator/templates/crd.emqxes.apps.emqx.io.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12889,8 +12889,14 @@ spec:
nodes:
items:
properties:
connections:
format: int64
type: integer
edition:
type: string
live_connections:
format: int64
type: integer
node:
type: string
node_status:
Expand Down Expand Up @@ -12923,8 +12929,14 @@ spec:
nodes:
items:
properties:
connections:
format: int64
type: integer
edition:
type: string
live_connections:
format: int64
type: integer
node:
type: string
node_status:
Expand Down
2 changes: 2 additions & 0 deletions docs/en_US/reference/v2alpha2-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ _Appears in:_
| `role` _string_ | EMQX cluster node role, enum: "core" "replicant" |
| `edition` _string_ | EMQX cluster node edition, enum: "Opensource" "Enterprise" |
| `uptime` _integer_ | EMQX node uptime, milliseconds |
| `connections` _integer_ | In EMQX's API of `/api/v5/nodes`, the `connections` field means the number of MQTT session count, |
| `live_connections` _integer_ | In EMQX's API of `/api/v5/nodes`, the `live_connections` field means the number of connected MQTT clients. THe `live_connections` just work in EMQX 5.1 or later. |


#### EMQXNodesStatus
Expand Down
2 changes: 2 additions & 0 deletions docs/zh_CN/reference/v2alpha2-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ _Appears in:_
| `role` _string_ | EMQX cluster node role, enum: "core" "replicant" |
| `edition` _string_ | EMQX cluster node edition, enum: "Opensource" "Enterprise" |
| `uptime` _integer_ | EMQX node uptime, milliseconds |
| `connections` _integer_ | In EMQX's API of `/api/v5/nodes`, the `connections` field means the number of MQTT session count, |
| `live_connections` _integer_ | In EMQX's API of `/api/v5/nodes`, the `live_connections` field means the number of connected MQTT clients. THe `live_connections` just work in EMQX 5.1 or later. |


#### EMQXNodesStatus
Expand Down

0 comments on commit ba93d93

Please sign in to comment.