Opened 18 months ago

Last modified 15 months ago

#24028 assigned enhancement

Provide a modernized API for metrics-lib

Reported by: iwakeh Owned by: metrics-team
Priority: Medium Milestone:
Component: Metrics/Library Version:
Severity: Normal Keywords: metrics-2018
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by iwakeh)

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.

Child Tickets

Change History (6)

comment:1 Changed 18 months ago by iwakeh

Owner: changed from metrics-team to iwakeh
Status: newaccepted

Setting to accepted, as I'm looking into providing the minimal use-case prototype for further discussion.

comment:2 in reply to:  description ; Changed 18 months ago by 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."

comment:3 in reply to:  2 Changed 18 months ago by iwakeh

Description: modified (diff)

Replying to 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.

comment:4 Changed 17 months ago by karsten

As discussed on #24036, we should make the following changes:

  • Rename root package org.torproject.descriptor to org.torproject.metrics.descriptor to make it part of the Tor Metrics name space.
  • org.torproject.descriptor.index becomes org.torproject.metrics.index (without descriptor), because it contains functionality that is supposed to be internally shared with other code bases that is unrelated to descriptor parsing.

comment:5 Changed 16 months ago by iwakeh

Keywords: metrics-2018 added; metrics-2017 removed

Will be completed in 2018.

comment:6 Changed 15 months ago by iwakeh

Owner: changed from iwakeh to metrics-team
Status: acceptedassigned

Move to metrics-team as these are not worked on by me during the next week.

Note: See TracTickets for help on using tickets.