[tor-bugs] #24028 [Metrics/Library]: Provide a modernized API for metrics-lib
Tor Bug Tracker & Wiki
blackhole at torproject.org
Fri Oct 27 18:32:03 UTC 2017
#24028: Provide a modernized API for metrics-lib
-----------------------------+--------------------------
Reporter: iwakeh | Owner: iwakeh
Type: enhancement | Status: accepted
Priority: Medium | Milestone:
Component: Metrics/Library | Version:
Severity: Normal | Resolution:
Keywords: metrics-2017 | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
-----------------------------+--------------------------
Old description:
> In order to provide a more modern API in metrics-lib the interface
> hierarchy needs to be renewed/restructured/changed in backwards
> compatible ways.
>
> A separate discussion led to the following results:
>
> * The new interfaces will be placed in new packages, which allows for
> keeping good names and improving other w/o disturbing the existing
> classes. Suggested packages:
> - org.torproject.metrics.descriptor
> - org.torproject.metrics.descriptor.impl
> - org.torproject.metrics.index
> - org.torproject.metrics.internal
>
> * Besides improving the general structure consider different return types
> for all time related values and use java.util.Optional for all optional
> values and other java 8 features (as mentioned in summary ticket #23752).
>
> Possible next steps:
>
> * Use a small, i.e., limited to few classes/interfaces, prototype example
> for finding the right approach to make these two interface hierarchies
> live beside each other and minimize additional implementation.
> * Use the working prototype approach to try new naming rules for methods.
> * Extend the found solution to the entire public API.
> * Choose first code base to use the new interface hierarchy.
> * Possibly improve new interface hierarchy.
> * Use new interfaces in all Metrics products.
>
> The other ticket related to an improved metrics-lib API is obsolete with
> this new approach; for reference: #19640. There is a pending new
> interfaces, which should be only implemented with the new hierarchy (if
> demand permits): #17861.
> The work-in-progress interfaces (and implementations) for webstats could
> be moved into the new hierarchy already, but could also be easily moved
> later.
New description:
In order to provide a more modern API in metrics-lib the interface
hierarchy needs to be renewed/restructured/changed in backwards compatible
ways.
A separate discussion led to the following results:
* The new interfaces will be placed in new packages, which allows for
keeping good names and improving other w/o disturbing the existing
classes. Suggested packages:
- org.torproject.metrics.descriptor
- org.torproject.metrics.descriptor.impl
- org.torproject.metrics.index
- org.torproject.metrics.internal
* Besides improving the general structure consider different return types
for all time related values and use java.util.Optional for all optional
values and other java 8 features (as mentioned in summary ticket #23752).
Possible next steps:
* Use a small, i.e., limited to few classes/interfaces, prototype example
for finding the right approach to make these two interface hierarchies
live beside each other and minimize additional implementation.
* Use the working prototype approach to try new naming rules for methods.
* Extend the found solution to the entire public API.
* Choose first code base to use the new interface hierarchy.
* Possibly improve new interface hierarchy.
* Use new interfaces in all Metrics products.
The other ticket related to an improved metrics-lib API is obsolete with
this new approach; for reference and as improvement-idea resource: #19640.
There is a pending new interfaces, which should be only implemented with
the new hierarchy (if demand permits): #17861.
The work-in-progress interfaces (and implementations) for webstats could
be moved into the new hierarchy already, but could also be easily moved
later.
--
Comment (by iwakeh):
Replying to [comment:2 karsten]:
> Sounds great. But let's not ignore all the work we put into #19640. The
ideas on that ticket might be very relevant for the step "Possibly improve
new interface hierarchy."
Yes, that's what I intended too. I'll rephrase the description a bit.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24028#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list