BIND 10 #2225: Implement counters into Xfrout (3/3)

BIND 10 Development do-not-reply at isc.org
Mon Nov 19 05:54:26 UTC 2012


#2225: Implement counters into Xfrout (3/3)
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  UnAssigned
  naokikambe                         |                Status:  reviewing
                       Type:         |             Milestone:
  enhancement                        |  Sprint-20121120
                   Priority:         |            Resolution:
  medium                             |             Sensitive:  0
                  Component:         |           Sub-Project:  DNS
  xfrout                             |  Estimated Difficulty:  7
                   Keywords:         |           Total Hours:  0
            Defect Severity:  N/A    |
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------

Comment (by jinmei):

 I can't understand the point of the things defined in
 statistics/counter.py.  Defining a common base class for counters
 is probably a good idea, but I don't understand what it buys
 with the convoluted trick of `_COUNTER` and `init()`.  After all,
 most of xfrout-specific work is implemented in `XfroutCounter`,
 so it seems to be sufficient if we just use a straightforward mapping
 (dict) from a counter name to value.

 I'm also concerned about the singleton nature of the counter object.
 IMO, a singleton is generally a source of all problems (very
 unfriendly with tests to name one) and should be avoided unless
 absolutely necessary.  Since I don't see the need for the trick, I
 don't understand why it's absolutely necessary either.

 In any case, it's very awkward to see things like inc_notifyoutv4()
 and `XfroutCounter` are defined in the generic counter module.  It
 should be defined somewhere else, somewhere more specific to the
 relevant module(s).  Same sense of comment applies to the module
 description.  Using some specific module as an example is probably
 good to help understand it, but I think the general description should
 be independent from a specific module.

 One more specific comment:

 - I don't understand what this means:
 {{{#!python
 These accessors are effective in other module. For example, in case
 that this module `counter.py` is once imported in such a main module
 as b10-xfrout, Regarding the item `notifyoutv4`, the incrementer
 inc_notifyoutv4() can be invoked via other module like notify_out.py,
 which is firstly imported in the main module.
 }}}
  (and I'm not sure if I understand any of the description below this
  paragraph)

 I'm stopping here, as I can't understand some basic part of the branch.

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


More information about the bind10-tickets mailing list