[tor-bugs] #15989 [Tor]: Add AccountingRule in and out

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jan 4 07:17:49 UTC 2016


#15989: Add AccountingRule in and out
----------------------------------+------------------------------------
 Reporter:  teor                  |          Owner:
     Type:  enhancement           |         Status:  needs_review
 Priority:  Low                   |      Milestone:  Tor: 0.2.8.x-final
Component:  Tor                   |        Version:  Tor: unspecified
 Severity:  Normal                |     Resolution:
 Keywords:  lorax tor-relay easy  |  Actual Points:
Parent ID:                        |         Points:
  Sponsor:                        |
----------------------------------+------------------------------------
Changes (by teor):

 * milestone:  Tor: 0.2.??? => Tor: 0.2.8.x-final


Comment:

 Thanks for the patch. The core of the changes looks great. (And we can
 work on AccountingEnableDirPort later if you'd like.)

 Just a few minor tweaks to the GETINFO/logging changes:
 * For "accounting/bytes", we don't change it based on the accounting rule.
 Tor always provides the read and written values. We need to continue to
 provide both values, otherwise, we might break tools that rely on there
 being two values.
   * (If tools want to know how much is left under the current rule, they
 can use "accounting/bytes-left".)
 * In "accounting/bytes-left", please provide values for read and written
 even if the accounting rule is IN or OUT. (Tools might rely on there being
 two values.) I suggest using `limit` when read or written is unlimited.
   * Note that the order of the values is `read` then `written`, so IN will
 be `read-left` `limit` and OUT will be `limit` `written-left`.
 * the code in log_accounting that handles SUM is wrong, and the current
 format isn't great for IN or OUT either. Can we change the format to:
 {{{
 log_notice(LD_HEARTBEAT, "Heartbeat: Accounting enabled. "
       "Sent: %s, Received: %s, Used: %s / %s, Rule: %s. The "
       "current accounting interval ends on %s, in %s.",
       acc_sent, acc_rcvd, acc_used, acc_max, acc_rule, end_buf,
 remaining);
 }}}
   Where acc_used is bytes_to_usage(get_accounting_bytes()), and acc_rule
 is an accounting rule string like the one in the man page?

 A minor nitpick:

 The changes file has no newline at the end of the file. This might screw
 up our ChangeLog scripts.

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


More information about the tor-bugs mailing list