| | |
- TorCtl.PathSupport.PathBuilder(TorCtl.TorCtl.EventHandler)
-
- StatsHandler
- BandwidthStats
- ReasonRouterList
-
- FailedRouterList
- SuspectRouterList
- TorCtl.TorCtl.Router
-
- StatsRouter
class BandwidthStats |
| |
Class that manages observed bandwidth through a Router |
| |
Methods defined here:
- __init__(self)
- add_bw(self, bytes, duration)
- Add an observed transfer of 'bytes' for 'duration' seconds
|
class ReasonRouterList |
| |
Helper class to track which Routers have failed for a given reason |
| |
Methods defined here:
- __init__(self, reason)
- add_r(self, r)
- Add a router to the list for this reason
- sort_list(self)
- total_failed(self)
- Get a list of total failures for this reason
- total_suspected(self)
- Get a list of total suspected failures for this reason
- write_list(self, f)
- Write the list of failure counts for this reason 'f'
|
class StatsHandler(TorCtl.PathSupport.PathBuilder) |
| |
An extension of PathSupport.PathBuilder that keeps track of
router statistics for every circuit and stream |
| |
- Method resolution order:
- StatsHandler
- TorCtl.PathSupport.PathBuilder
- TorCtl.TorCtl.EventHandler
Methods defined here:
- __init__(self, c, slmgr)
- circ_status_event(self, c)
- count_stream_reason_failed(self, s, reason)
- Count the routers involved in a failure
- count_stream_suspects(self, s, lreason, reason)
- Count the routers 'suspected' of being involved in a failure
- ns_event(self, n)
- reset_stats(self)
- run_zbtest(self)
- Run unweighted z-test to calculate the probabilities of a node
having a given stream bandwidth based on the Normal distribution
- run_zrtest(self)
- Run unweighted z-test to calculate the probabilities of a node
having a given ratio of stream bandwidth to advertised bandwidth
based on the Normal distribution
- stream_status_event(self, s)
- write_reasons(self, f, reasons, name)
- Write out all the failure reasons and statistics for all Routers
- write_routers(self, f, rlist, name)
- Write out all the usage statistics for all Routers
- write_stats(self, filename)
- Write out all the statistics the StatsHandler has gathered
Methods inherited from TorCtl.PathSupport.PathBuilder:
- attach_stream_any(self, stream, badcircs)
- Attach a stream to a valid circuit, avoiding any in 'badcircs'
- bandwidth_event(self, b)
- build_path(self)
- Get a path from the SelectionManager's PathSelector, can be used
e.g. for generating paths without actually creating any circuits
- heartbeat_event(self, event)
- This function handles dispatching scheduled jobs. If you
extend PathBuilder and want to implement this function for
some reason, be sure to call the parent class
- new_desc_event(self, d)
- read_routers(self, nslist)
- schedule_immediate(self, job)
- Schedules an immediate job to be run before the next event is
processed.
- schedule_low_prio(self, job)
- Schedules a job to be run when a non-time critical event arrives.
- schedule_selmgr(self, job)
- Schedules an immediate job to be run before the next event is
processed. Also notifies the selection manager that it needs
to update itself.
- stream_bw_event(self, s)
Methods inherited from TorCtl.TorCtl.EventHandler:
- address_mapped_event(self, event)
- Called when Tor adds a mapping for an address if listening
to ADDRESSMAPPED events.
- msg_event(self, event)
- Called when a log message of a given severity arrives if listening
to INFO_MSG, NOTICE_MSG, WARN_MSG, or ERR_MSG events.
- or_conn_status_event(self, event)
- Called when an OR connection's status changes if listening to
ORCONNSTATUS events.
- unknown_event(self, event)
- Called when we get an event type we don't recognize. This
is almost alwyas an error.
|
class StatsRouter(TorCtl.TorCtl.Router) |
| |
Extended Router to handle statistics markup |
| |
Methods defined here:
- __init__(self, router)
- 'Promotion Constructor' that converts a Router directly into a
StatsRouter without a copy.
- __str__(self)
- avg_extend_time(self)
- Return the average amount of time it took for this router
to extend a circuit one hop
- bw_ratio(self)
- Return the ratio of the Router's advertised bandwidth to its
observed average stream bandwidth
- current_uptime(self)
- failed_per_hour(self)
- Return the number of circuit extend failures per hour for this
Router
- reset(self)
- Reset all stats on this Router
- sanity_check(self)
- Makes sure all stats are self-consistent
- suspected_per_hour(self)
- Return the number of circuits that failed with this router as an
earlier hop
Data and other attributes defined here:
- key = 'Metatroller Statistics:\n CC=Circuits Chosen C...z-test value\n PR=Prob(z-ratio) U=Uptime (h)\n'
Methods inherited from TorCtl.TorCtl.Router:
- update_to(self, new)
- Somewhat hackish method to update this router to be a copy of
'new'
- will_exit_to(self, ip, port)
- Check the entire exitpolicy to see if the router will allow
connections to 'ip':'port'
Data and other attributes inherited from TorCtl.TorCtl.Router:
- build_from_desc = <TorCtl.TorUtil.Callable instance at 0x9b61b8c>
|
|