Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fields for HealthCheck #902

Merged
merged 3 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions pkg/apis/submariner.io/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ type Endpoint struct {
}

type EndpointSpec struct {
ClusterID string `json:"cluster_id"`
CableName string `json:"cable_name"`
ClusterID string `json:"cluster_id"`
CableName string `json:"cable_name"`
// +optional
HealthCheckIP string `json:"healthCheckIP,omitempty"`
Hostname string `json:"hostname"`
Subnets []string `json:"subnets"`
PrivateIP string `json:"private_ip"`
Expand Down Expand Up @@ -81,6 +83,16 @@ type GatewayStatus struct {
Connections []Connection `json:"connections"`
}

// LatencySpec describes the round trip time information in miliseconds for a packet
// between the gateway pods of two clusters.
type LatencySpec struct {
LastRTT float64 `json:"lastRTT"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for changing these to float and ms units?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value in nano seconds seems to be not understandable, like

Latency:
Average RTT: 585160
Last RTT: 403876
Max RTT: 839461
Min RTT: 403876
Stddev RTT: 185170

So to make it similar to normal ping response changed it to float and ms unit

Latency:
Average RTT: 0.724
Last RTT: 0.635
Max RTT: 0.857
Min RTT: 0.635
Stddev RTT: 0.095

Copy link
Contributor

@tpantelis tpantelis Nov 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - but it was already approved in the previous form so now need re-review.

@nyechiel seems reasonable - what do you think?

MinRTT float64 `json:"minRTT"`
AverageRTT float64 `json:"averageRTT"`
MaxRTT float64 `json:"maxRTT"`
StdDevRTT float64 `json:"stddevRTT"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type GatewayList struct {
Expand All @@ -100,6 +112,8 @@ type Connection struct {
Status ConnectionStatus `json:"status"`
StatusMessage string `json:"statusMessage"`
Endpoint EndpointSpec `json:"endpoint"`
// +optional
Latency *LatencySpec `json:"latency,omitempty"`
}

type ConnectionStatus string
Expand Down
21 changes: 21 additions & 0 deletions pkg/apis/submariner.io/v1/zz_generated.deepcopy.go

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