| |
|
- TorCtl.PathSupport.PathBuilder(TorCtl.TorCtl.ConsensusTracker)
-
- 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.ConsensusTracker
- TorCtl.TorCtl.EventHandler
- TorCtl.TorCtl.EventSink
Methods defined here:
- __init__(self, c, slmgr, RouterClass=<class TorCtl.StatsSupport.StatsRouter at 0xa7a4398c>, track_ranks=False)
- avg_adv_bw(self)
- avg_circ_failure(self)
- avg_circ_suspects(self)
- avg_stream_failure(self)
- avg_stream_suspects(self)
- circ_status_event(self, c)
- close_circuit(self, id)
- 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
- new_consensus_event(self, n)
- new_desc_event(self, d)
- reset(self)
- 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_ratios(self, filename)
- Write out bandwith ratio stats StatsHandler has gathered
- 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
Data and other attributes defined here:
- ratio_key = ‘Metatroller Ratio Statistics:n SR=Stream avg ra…eam Countn P=Percentile Rank U=Uptime (h)n‘
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
- circuit_list(self)
- Return an iterator or a list of circuits prioritized for
stream selection.
- close_all_circuits(self)
- Close all open circuits
- close_all_streams(self, reason)
- Close all open streams
- 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
- 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)
Data and other attributes inherited from TorCtl.PathSupport.PathBuilder:
- is_urgent_event = <TorCtl.TorUtil.Callable instance at 0x82637ac>
Methods inherited from TorCtl.TorCtl.ConsensusTracker:
- current_consensus(self)
- update_consensus(self)
Methods inherited from TorCtl.TorCtl.EventHandler:
- add_event_listener(self, evlistener)
- address_mapped_event(self, event)
- Called when Tor adds a mapping for an address if listening
to ADDRESSMAPPED events.
- buildtimeout_set_event(self, event)
- guard_event(self, event)
- 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.
- ns_event(self, event)
- or_conn_status_event(self, event)
- Called when an OR connection's status changes if listening to
ORCONNSTATUS events.
- timer_event(self, event)
- unknown_event(self, event)
- Called when we get an event type we don't recognize. This
is almost alwyas an error.
|
|