BIND 10 #2157: Create an interface to pass statistics counters in Auth module

BIND 10 Development do-not-reply at isc.org
Wed Oct 10 22:05:27 UTC 2012


#2157: Create an interface to pass statistics counters in Auth module
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jinmei
  y-aharen                           |                Status:  reviewing
                       Type:         |             Milestone:
  enhancement                        |  Sprint-20121023
                   Priority:         |            Resolution:
  medium                             |             Sensitive:  0
                  Component:         |           Sub-Project:  DNS
  b10-auth                           |  Estimated Difficulty:  8
                   Keywords:         |           Total Hours:  0
            Defect Severity:  N/A    |
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------

Comment (by jinmei):

 Replying to [comment:18 y-aharen]:

 > I had misread your comment and split parametrized counters.

 Sorry, maybe I wasn't clear enough.  That's not what I meant.

 My point was whether we decided to hardcode all specific RR types like
 this:

 {{{
             "qtype": {
                 "a": 0,
                 "ns": 0,
                 "md": 0,
                 "mf": 0,
 ...
                 "dlv": 0,
                 "other": 0
             },
 }}}

 (and same goes for opcode, rcode, etc).  I don't remember we did, and
 I personally would like to avoid this type of hardcoding in general
 (if I sounded differently when we met face-to-face last month, I was
 probably unclear and I apologize for that - but I never liked that
 hardcoding).

 What I personally would like to see is, at the concept level, that we
 only have something named "qtype" counters.  This name is the only
 hardcoded information.  In an actual implementation of this counter,
 there would be some form of array or vector internally, and its
 `increment()` method takes `RRType`, identifying the appropriate
 array/vector index, and increment the value there.

 {{{#!cpp
 class RRTypeCounter {
 public:
     void increment(const RRType& type) {
         const size_t code = type.getCode();
         if (code < SOME_THRESHOLD) {
             ++counters_[code];
         } else {
             ++counters_[OTHER_INDEX];
         }
     }
 private:
     uint64_t counters_[SOME_REASONABLE_VALUE];
 };
 }}}

-- 
Ticket URL: <http://bind10.isc.org/ticket/2157#comment:19>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list