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

feature: add request handling statistics for pouch daemon #2037

Closed

Conversation

allencloud
Copy link
Collaborator

@allencloud allencloud commented Aug 2, 2018

Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com

Ⅰ. Describe what this PR did

When called by upper systems, pouch daemon bears lots of requests there. Then what is the dealing status of all these request is a quite important dimension for evaluate whether the daemon deals them very well.

For the API layers, we plan to provide a brand new API endpoint:

GET /stats

It returns ResponseStats:

// ResponseStats ResponseStats contains all request handling result in daemon including 2xx3xx response number, 4xx and 5xx number.
// swagger:model ResponseStats

type ResponseStats struct {

	// all requests number handled by daemon no matter success or failure.
	AllRequests uint64 `json:"AllRequests,omitempty"`

	// all response number returned by daemon which is 4xx status code.
	Req4xxCount uint64 `json:"Req4xxCount,omitempty"`

	// all response number returned by daemon which is 5xx status code.
	Req5xxCount uint64 `json:"Req5xxCount,omitempty"`

	// all response number returned by daemon which is 2xx or 3xx status code.
	Req2xx3xxCount uint64 `json:"req2xx3xxCount,omitempty"`
}

If the pouchd restarts, then all the data will start from 0.

Ⅱ. Does this pull request fix one issue?

none

Ⅲ. Describe how you did it

none

Ⅳ. Describe how to verify it

none

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Aug 2, 2018

Codecov Report

Merging #2037 into master will increase coverage by 38.6%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2037      +/-   ##
==========================================
+ Coverage   23.47%   62.08%   +38.6%     
==========================================
  Files         180      200      +20     
  Lines       15860    15547     -313     
==========================================
+ Hits         3723     9652    +5929     
+ Misses      11860     4677    -7183     
- Partials      277     1218     +941
Flag Coverage Δ
#criv1alpha1test 33.74% <12.5%> (?)
#criv1alpha2test 34.25% <12.5%> (?)
#integrationtest 38.54% <100%> (?)
#unittest 21.98% <0%> (-1.5%) ⬇️
Impacted Files Coverage Δ
apis/server/router.go 92.3% <100%> (+92.3%) ⬆️
apis/opts/portbindings.go 0% <0%> (-80.96%) ⬇️
storage/volume/driver/fake_driver.go 0% <0%> (-50%) ⬇️
storage/volume/types/volume_util.go 16.44% <0%> (-46.06%) ⬇️
apis/opts/spec_annotation.go 60% <0%> (-40%) ⬇️
daemon/logger/syslog/syslog.go 25% <0%> (-37.07%) ⬇️
storage/volume/core_util.go 10.34% <0%> (-32.52%) ⬇️
apis/opts/memory_swap.go 81.81% <0%> (-18.19%) ⬇️
storage/volume/driver/proxy.go 53.42% <0%> (-13.7%) ⬇️
storage/volume/driver/driver.go 44.96% <0%> (-13.24%) ⬇️
... and 169 more

@allencloud
Copy link
Collaborator Author

I think we need to review the API very carefully. @HusterWan @fuweid

Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
@pouchrobot
Copy link
Collaborator

ping @allencloud
Conflict happens after merging a previous commit.
Please rebase the branch against master and push it back again. Thanks a lot.

@fuweid
Copy link
Contributor

fuweid commented Mar 15, 2019

will reopen it if we need it.

cc @allencloud

@fuweid fuweid closed this Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants