Re: [tor-bugs] #22196 [Metrics/metrics-lib]: Configure descriptor sources using method chaining

2017-06-20 Thread Tor Bug Tracker & Wiki
#22196: Configure descriptor sources using method chaining
-+--
 Reporter:  karsten  |  Owner:  karsten
 Type:  enhancement  | Status:  assigned
 Priority:  Medium   |  Milestone:
Component:  Metrics/metrics-lib  |Version:
 Severity:  Normal   | Resolution:
 Keywords:   |  Actual Points:
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+--
Changes (by karsten):

 * milestone:  metrics-lib 1.9.0 =>


Comment:

 As explained in
 [https://trac.torproject.org/projects/tor/ticket/22141#comment:13 this
 comment], we can't just dump the parse history and replace it with a
 `minLastModified` timestamp.  We should reconsider which of these changes
 we can make, and we won't be able to do that for 1.9.0 anymore.  Moving
 out of the currently planned milestones.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #22196 [Metrics/metrics-lib]: Configure descriptor sources using method chaining

2017-06-12 Thread Tor Bug Tracker & Wiki
#22196: Configure descriptor sources using method chaining
-+---
 Reporter:  karsten  |  Owner:  karsten
 Type:  enhancement  | Status:  assigned
 Priority:  Medium   |  Milestone:  metrics-lib 1.9.0
Component:  Metrics/metrics-lib  |Version:
 Severity:  Normal   | Resolution:
 Keywords:   |  Actual Points:
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+---
Changes (by karsten):

 * status:  new => assigned
 * owner:  metrics-team => karsten


Comment:

 Great!  I'll tackle this one after #22141 then.  Thanks for checking!

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #22196 [Metrics/metrics-lib]: Configure descriptor sources using method chaining

2017-06-12 Thread Tor Bug Tracker & Wiki
#22196: Configure descriptor sources using method chaining
-+---
 Reporter:  karsten  |  Owner:  metrics-team
 Type:  enhancement  | Status:  new
 Priority:  Medium   |  Milestone:  metrics-lib 1.9.0
Component:  Metrics/metrics-lib  |Version:
 Severity:  Normal   | Resolution:
 Keywords:   |  Actual Points:
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+---

Comment (by iwakeh):

 Yes, using overloading here makes sense (and not using the configuration
 methods safes the hassle of determining when configuration is allowed or
 not).

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #22196 [Metrics/metrics-lib]: Configure descriptor sources using method chaining

2017-06-12 Thread Tor Bug Tracker & Wiki
#22196: Configure descriptor sources using method chaining
-+---
 Reporter:  karsten  |  Owner:  metrics-team
 Type:  enhancement  | Status:  new
 Priority:  Medium   |  Milestone:  metrics-lib 1.9.0
Component:  Metrics/metrics-lib  |Version:
 Severity:  Normal   | Resolution:
 Keywords:   |  Actual Points:
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+---

Comment (by karsten):

 I had the following idea when working on #22141:

 Maybe we can avoid configuring descriptor sources entirely and go with
 overloaded, state-less methods like the one we have in
 `DescriptorCollector`.  The main obstacle here is `DescriptorReader`'s
 parse history where the application needs a way to save the parse history
 to file to disk once it's done processing descriptors.  Maybe we can work
 around that obstacle by using `minLastModified` in `DescriptorReader` as
 we're using in `DescriptorCollector`.  Here are possible method signatures
 in the three non-deprecated descriptor sources:

 {{{
 DescriptorParser:
   Iterable parse(byte[] rawDescriptorBytes);

 DescriptorCollector:
   void collect(
   File localDirectory,
   String collecTorBaseUrl,
   String... remoteDirectories);
   void collect(
   long minLastModified,
   File localDirectory,
   String collecTorBaseUrl,
   String... remoteDirectories);
   void collect(
   boolean deleteExtraneousLocalFiles,
   long minLastModified,
   File localDirectory,
   String collecTorBaseUrl,
   String... remoteDirectories);

 DescriptorReader:
   Iterable read(
   File... descriptorFiles);
   Iterable read(
   long minLastModified,
   File... descriptorFiles);
   Iterable read(
   int maxDescriptorsInQueue,
   long minLastModified,
   File... descriptorFiles);
 }}}

 An application that wants to process only newly added descriptors would
 start by retrieving a current timestamp to mark the beginning of its
 current execution.  It would then load the last execution timestamp from
 disk (rather than let metrics-lib load the last parse history) and pass
 that timestamp as `minLastModified` to both `collect()` and `read()`.  In
 fact, it might want to subtract 15 or 30 minutes from that timestamp to
 account for clock skew with the CollecTor server.  And when it's done
 processing descriptors it saves the current timestamp for the next
 execution (rather than let metrics-lib save the parse history to disk).

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #22196 [Metrics/metrics-lib]: Configure descriptor sources using method chaining

2017-06-02 Thread Tor Bug Tracker & Wiki
#22196: Configure descriptor sources using method chaining
-+---
 Reporter:  karsten  |  Owner:  metrics-team
 Type:  enhancement  | Status:  new
 Priority:  Medium   |  Milestone:  metrics-lib 1.9.0
Component:  Metrics/metrics-lib  |Version:
 Severity:  Normal   | Resolution:
 Keywords:   |  Actual Points:
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+---
Changes (by karsten):

 * milestone:  metrics-lib 2.0.0 => metrics-lib 1.9.0


Comment:

 Let's try to squeeze this into 1.9.0, so that we can finish all interface
 changes before 2.0.0 when we can remove deprecated interface parts and
 after which we won't be able to do that again before 3.0.0.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #22196 [Metrics/metrics-lib]: Configure descriptor sources using method chaining

2017-05-12 Thread Tor Bug Tracker & Wiki
#22196: Configure descriptor sources using method chaining
-+---
 Reporter:  karsten  |  Owner:  metrics-team
 Type:  enhancement  | Status:  new
 Priority:  Medium   |  Milestone:  metrics-lib 2.0.0
Component:  Metrics/metrics-lib  |Version:
 Severity:  Normal   | Resolution:
 Keywords:   |  Actual Points:
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+---
Changes (by iwakeh):

 * milestone:   => metrics-lib 2.0.0


--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

[tor-bugs] #22196 [Metrics/metrics-lib]: Configure descriptor sources using method chaining

2017-05-08 Thread Tor Bug Tracker & Wiki
#22196: Configure descriptor sources using method chaining
-+--
 Reporter:  karsten  |  Owner:  metrics-team
 Type:  enhancement  | Status:  new
 Priority:  Medium   |  Milestone:
Component:  Metrics/metrics-lib  |Version:
 Severity:  Normal   |   Keywords:
Actual Points:   |  Parent ID:
   Points:   |   Reviewer:
  Sponsor:   |
-+--
 The two descriptor sources `DescriptorReader` and `DescriptorParser` are
 instantiated by `DescriptorSourceFactory`, configured, and then executed.
 This requires state checks and leads to quite verbose application code.
 An exception to this is `DescriptorCollector` which is state-less but
 which has a method with 5 parameters, which also does not produce very
 readable code.

 We should consider switching to configuring descriptor sources using
 method chanining.  [https://gitweb.torproject.org/user/karsten/metrics-
 lib.git/commit/?h=task-16225=f8c5862bbdfa0acefbbbd7d4899b997077c20196
 Here's a code sample] from a few months ago, written for another ticket.

 iwakeh rightly
 [https://trac.torproject.org/projects/tor/ticket/16225#comment:6 commented
 on that other ticket]: "configuration of a descriptor source by fluent-
 style (or method chaining) is fine, but metrics-lib currently has the
 DescriptorSourceFactory approach, which would need to be adapted. That is,
 I see two things: the ideas around the code of DescriptorSourceBuilder are
 ideas about a new way of configuration and not exception/error handling in
 metrics-lib, i.e. a different ticket (there is one for redesign of the
 interface hierarchy, I'll look for it). Second, the current configuration
 and descriptor source instanciation need to be considered together (in
 that other ticket)."

 Not assigning to a milestone on purpose.  This likely needs more thoughts
 before we can write code and make plans for releasing that.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs