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

ServerStatusMetric API refresh follow-up

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • Service Arch 2022-06-27, Service Arch 2022-07-11

      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;
      };
      

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

              Created:
              Updated:
              Resolved: