Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.6.4, 5.0.1, 5.1.0
Description
In ns_server, we can fetch statistics via a REST call to /pools/default/buckets/BUCKETNAME/stats
or node specific stats at:
/pools/default/buckets/BUCKETNAME/nodes/NODE/stats
On this call, we can provide a URL parameter "zoom" which takes the following values:
{Step0, Period, Count0} = case proplists:get_value("zoom", Params) of |
"minute" -> {1, minute, 60}; |
"hour" -> {60, hour, 900}; |
"day" -> {1440, day, 1440}; |
"week" -> {11520, week, 1152}; |
"month" -> {44640, month, 1488}; |
"year" -> {527040, year, 1464}; |
undefined -> {1, minute, 60}
|
end, |
If we added an option for "instant" which returns only 1 sample for the latest minute, this would make it very easy for people to connect their monitoring platform to Couchbase, whilst making the minimum amount of code change and maximising reliability.
Other more-custom methods such as allowing a parameter to override the number of samples that should be returned may allow for more flexibility, but would add to the codebase and testing requirements, whereas adding a simple one-sample option should require minimal code change to achieve a workable result.
Suggested Fix:
{Step0, Period, Count0} = case proplists:get_value("zoom", Params) of |
"instant" -> {1, minute, 1}; |
"minute" -> {1, minute, 60}; |
"hour" -> {60, hour, 900}; |
"day" -> {1440, day, 1440}; |
"week" -> {11520, week, 1152}; |
"month" -> {44640, month, 1488}; |
"year" -> {527040, year, 1464}; |
undefined -> {1, minute, 60}
|
end, |
Attachments
Gerrit Reviews
For Gerrit Dashboard: MB-29677 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
94300,2 | MB-29677: Add instant as a zoom option for stats | vulcan | ns_server | Status: NEW | 0 | +1 |