Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-67333

ServerStatusMetric API refresh follow-up

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • ALL
    • Service Arch 2022-06-27, Service Arch 2022-07-11

    Description

      During development, I've received the following idea it might be interesting to pursue as a follow-up to the work which has already been done in SERVER-65987.

      The argument for it is that the produced version was verbose and may lead to errors. Here's the link for the complete discussion.

      /**
       * Mostly can be declarad and used wherever and however
       * a `Counter64` can be used, but it's backed by a metric.
       */
      class CounterMetric {
      public:
          CounterMetric(std::string name)
              : _counter{makeServerStatusCounter(std::move(name)).value()} {}
          CounterMetric(CounterMetric&) = delete;
          CounterMetric& operator=(CounterMetric&) = delete;
       
          operator Counter64& () { return _counter; }
       
          void increment() { return _counter.increment(); }  // + other common ops.
       
      private:
          Counter64& _counter;
      };
      

      Attachments

        Activity

          People

            daniel.morilha@mongodb.com Daniel Morilha (Inactive)
            daniel.morilha@mongodb.com Daniel Morilha (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: