Skip to content

Small fixes to the NGINX Plus client #4

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

Merged
merged 2 commits into from
Jun 15, 2018
Merged

Small fixes to the NGINX Plus client #4

merged 2 commits into from
Jun 15, 2018

Conversation

isaachawley
Copy link
Contributor

  • Add Total responses to upstream struct
  • Add json tag to HealthChecks property so it parses
  • Update comment

(If you add a 5s sleep before fetching upstream stats you can see the HealthChecks populated)

- Add Total responses to upstream struct
- Add json tag to HealthChecks property so it parses
- Update comment
@isaachawley isaachawley self-assigned this Jun 15, 2018
Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

(If you add a 5s sleep before fetching upstream stats you can see the HealthChecks populated)
5 seconds seems to much. what about 100ms?

@@ -108,6 +108,7 @@ type Responses struct {
Responses3xx uint64 `json:"3xx"`
Responses4xx uint64 `json:"4xx"`
Responses5xx uint64 `json:"5xx"`
Total uint64 `json:"total"`
Copy link
Contributor

Choose a reason for hiding this comment

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

is json:"total" requried?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks so weird without it

@@ -12,7 +12,7 @@ import (
// APIVersion is a version of NGINX Plus API.
const APIVersion = 2

// NginxClient lets you add/remove servers to/from NGINX Plus via its API.
// NginxClient lets you access NGINX Plus via its API.
Copy link
Contributor

Choose a reason for hiding this comment

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

NginxClient lets you access NGINX Plus via its API. -> NginxClient lets you access NGINX Plus API.
imho

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@isaachawley
Copy link
Contributor Author

I haven't added a sleep, and one isn't necessary imho, the test is fine with 0 values in the healthcheck.

- Fix comment
- Fix inconsistent test error string case
@pleshakov
Copy link
Contributor

👍

@isaachawley isaachawley merged commit 76c610f into master Jun 15, 2018
@isaachawley isaachawley deleted the small-issues branch June 15, 2018 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants