[metrics-bugs] #24041 [Metrics]: Add Apache Commons Configuration as configuration library

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Nov 14 14:52:57 UTC 2017


#24041: Add Apache Commons Configuration as configuration library
-------------------------+------------------------------
 Reporter:  karsten      |          Owner:  metrics-team
     Type:  enhancement  |         Status:  new
 Priority:  Medium       |      Milestone:
Component:  Metrics      |        Version:
 Severity:  Normal       |     Resolution:
 Keywords:               |  Actual Points:
Parent ID:               |         Points:
 Reviewer:               |        Sponsor:
-------------------------+------------------------------

Comment (by iwakeh):

 Maybe rather summarize this ticket as:  "Unify Metrics' products
 operational configuration"

 The method/process of deployment configuration of Metrics' products should
 be unified.
 Afterwards, we look for the 'tool' or lib helping to achieve a
 simplification.

 -------
 Some thoughts:

 It seems that from all options (hard-coding, command-line parameters, and
 config files) the config file solution is best.  Also, because a
 configuration file can be checked into a local git on the deployment
 machine, i.e., less guessing what parameters are needed/ were used.

 A configuration file should follow a format/standard.
 [https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html Java
 properties] should be first choice because they are easy to understand and
 Java provides the appropriate functionality for accessing them.  Second
 choice to make is between simple key-value properties and XML properties.
 IMO, the simple format ought to be sufficient and is better for 'human
 consumption'.

 CollecTor features the most complex configuration settings of all Metrics'
 products and is still based on simple key-value Java properties.
 All other products (cf. list below) have less configuration demands that
 could all be met by Java properties.

 Tools like commons-configuration provide 99% functionality that is beyond
 the needs of Metrics' products.  Using the functionality from there does
 not really simplify the code compared to using jdk-provided methods.


 Suggestion:

 1) Use key value properties files for configuration.
 2) Use Java provided functionality for accessing the properties.
 3) If there is the need for more sophisticated configuration methods
 throughout several products, look to provide them in a standardized way
 (i.e., in a metrics-lib's util package).




 -------------
 Overview of the current state as reference:

 - Onionoo: command line settings and hard coded settings
 - CollecTor: configuration file and Metrics' code for configuration checks
 and convenience methods incl. provision of a basic config file.  Using
 Java properties format.
 - ExoneraTor: configuration file read as a file (back end) and system
 properties (web part).
 - Web: mixture off all.
 - Bot: Apache Commons Configuration as configuration library (#23933).

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


More information about the metrics-bugs mailing list