[metrics-bugs] #33205 [Metrics/Library]: Move all parsing code out of constructors

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Feb 17 11:14:59 UTC 2020


#33205: Move all parsing code out of constructors
-----------------------------+--------------------------------
 Reporter:  karsten          |          Owner:  karsten
     Type:  defect           |         Status:  needs_revision
 Priority:  Medium           |      Milestone:
Component:  Metrics/Library  |        Version:
 Severity:  Normal           |     Resolution:
 Keywords:                   |  Actual Points:
Parent ID:                   |         Points:  2
 Reviewer:  irl              |        Sponsor:
-----------------------------+--------------------------------
Changes (by irl):

 * status:  needs_review => needs_revision


Comment:

 It's going to be a lot of boilerplate (unless there is some magic way to
 do it) but can we make it easier for users of metrics-lib to have getter
 methods parse if not parsed yet?

 Alternatively, we should throw an exception if attempting to get a value
 from a descriptor that hasn't been parsed yet.

 Just returning the default values from the classes isn't really great as
 this is going to lead to missing cases where the parse method wasn't
 invoked.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/33205#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the metrics-bugs mailing list