Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-29677

Allow "instant" as monitoring zoom parameter to retrieve one stats sample at a time

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • 4.6.4, 5.0.1, 5.1.0
    • ns_server

    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

        For Gerrit Dashboard: MB-29677
        # Subject Branch Project Status CR V

        Activity

          People

            phil.stott Phil Stott (Inactive)
            phil.stott Phil Stott (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 0.25h
                0.25h
                Remaining:
                Time Spent - 10m Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - 10m Remaining Estimate - 5m
                10m

                Gerrit Reviews

                  There is 1 open Gerrit change

                  PagerDuty