summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
| * Revising ResourceStats classDamian Johnson2014-10-21
| | | | | | | | | | | | | | | | | | | | | | Nothing much. Main difference is that we only registered stats if we had a new measurement. This was incorrect since we're supposed to register an update every second (not be limited by the rate of the tracker). I dislike the bytes => MB => bytes converting. Both this stat and bandwidth do this to shorten the y-axis labels but I'm starting to wonder if we should sacrifice a little data for proper labeling. Something to decide when revising the GraphPanel itself.
| * Revising ConnectionStats classDamian Johnson2014-10-21
| | | | | | | | | | Nothing much. Minor rename of the class, tweaks to the code. Only functional difference is that we now won't cause a stacktrace if our GETINFO calls fail.
| * Making title a GraphCategory constantDamian Johnson2014-10-21
| | | | | | | | | | | | No reason to have this be an attribute. It's just a simple constant for each subclass. Making this be a constant means we don't need to worry about cloning it, or having a constructor just to set it.
| * Renaming GraphStats to GraphCategoryDamian Johnson2014-10-21
| | | | | | | | | | The old name was confusing since we have a Stats class for the stats behind a single graph.
| * Dropping GraphStat's is_selected attributeDamian Johnson2014-10-21
| | | | | | | | No longer used, yet another little tidbit we can get rid of.
| * Dropping GraphStat's _process_event() methodDamian Johnson2014-10-21
| | | | | | | | | | Once upon a time it was really meaty but it's now just two lines of code. Not worth a helper just for that.
| * Dropping GraphStat's event_tick() methodDamian Johnson2014-10-21
| | | | | | | | | | | | This was just an alias for bandwidth_event(). It had a check to see if we were the pause buffer or not, but simply being judicial about registering the listener or not does the same.
| * Internally tracking intervals by name rather than indexDamian Johnson2014-10-19
| | | | | | | | | | | | Our GraphPanel's update_interval was the interval index rather than the interval itself since we used arrays for this. Now that we're using dictionaries this is better.
| * Have the graph panel govern its own redrawingDamian Johnson2014-10-19
| | | | | | | | | | | | Graph stats informed the graph panel when they were ready to be redrawn. This was kinda weird because it simply happened on a set schedule (it didn't really benefit anything). It's simpler if we just do this in the panel itself.
| * Use GraphStat constructor to cloneDamian Johnson2014-10-19
| | | | | | | | | | | | | | Common pattern among classes is for the constructor to clone if given an instance of its own type. For example, dict(my_dict) makes a shallow copy. Doing this for our GraphStats rather than having a custom clone() method.
| * Switching stat titles to be an attributeDamian Johnson2014-10-19
| | | | | | | | | | No need for these to be delegated to a method. All stats behave in the same way.
| * Moving graph statistical information to a Stat classDamian Johnson2014-10-18
| | | | | | | | | | | | | | Simple class to represent the statistical information on the graph. Yes, we had a previous GraphStat class but that confused the method that we'd use to fetch data with both a primary and secondary stat. This doubled the amount of code we needed. Oh, and the new Stat has a slightly nicer implementation.
| * Moving x-axis overriding from bandwidth stats to panelDamian Johnson2014-10-18
| | | | | | | | This lets us drop custom draw handling from the stats class.
| * Moving accounting info into the graph panelDamian Johnson2014-10-18
| | | | | | | | | | | | Shifting handling for accounting info from the bandwidth stats to the graph panel. This doesn't make things much better or worse at present, but it'll allow us to greatly simplify the stats.
| * Merging graph module into single fileDamian Johnson2014-10-12
| | | | | | | | | | | | | | Devious scheme is to rip this module a new one, simplifying it to the point that it can comfortably live in a single file. It's presently way on the long end of uncomfortable, but merging it will help push us along with this overhaul.
| * Moving UPDATE_INTERVALS to configurationDamian Johnson2014-10-12
| | | | | | | | Simply moving a constant from the graph panel to the config.
| * Draw block is a no-op without any statsDamian Johnson2014-10-12
| | | | | | | | | | Our graph panel's whole draw method was wrapped in a conditional. Minor tweak so we can unindent the whole method.
| * Moving graph stat inititalization into the graph panelDamian Johnson2014-10-12
| | | | | | | | | | | | | | | | | | | | Hmmmm, not sure why we did this. Our controller initialized graph stats then added them to the graph panel. Maybe this made sense with a past feature or pausing implementation. ... or maybe it still makes sense and I'm not spotting why. It's a lot simpler for the panel to be responsible for its own stats so going with this for now. Guess we'll see if this bites me down the line.
| * Replacing key integer codes with KeyInput classDamian Johnson2014-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Curses' getch() method returns an integer code for the pressed key. This is well and good, but needed both ui_tools helper functions and a lotta checks like... if key in (ord('s'), ord('S')): Wrapping user input with a KeyInput class that both makes this nicer... if key.match('s'): ... and includes the ui_tools helpers.
| * Standardizing help and key input panel methodsDamian Johnson2014-10-05
| | | | | | | | | | | | | | | | | | Few minor bits of standarization... * use the 'with' keyword for locking * use 'in' for evaluating againt multiple key inputs * drop the 'key_consumed' variable * return a list in the help function rather than repeatedly calling append()
| * Dropping GraphStats' is_visible() methodDamian Johnson2014-10-05
| | | | | | | | Method's completely unused, so easy one to drop.
| * Used a named tuple for header panel samplingsDamian Johnson2014-10-04
| | | | | | | | | | I keep swapping between dics, named tuples, and standalone classes for this. Think this is the best option I've come up with yet.
| * Minor draw revisionsDamian Johnson2014-09-21
| | | | | | | | Just a couple minor tweaks to make things a little less unnecessarily verbose.
| * Drop accounting rate configurabilityDamian Johnson2014-09-21
| | | | | | | | | | | | Config option probably nobody's ever set in the history of arm. Also bumping the rate since the only cost of doing so is a couple more GETINFO calls (Stem does a good job of caching the cacheable bits).
| * Give daemon tracker test more timeDamian Johnson2014-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our daemon tracker checks that when configured to run every 0.01 seconds it fires at *least* twice in 0.05. As with any timing test though this can still go awry... ====================================================================== FAIL: test_pausing_daemon (util.tracker.daemon.TestDaemon) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/mock.py", line 1201, in patched return func(*args, **keywargs) File "/home/atagar/Desktop/arm/test/util/tracker/daemon.py", line 76, in test_pausing_daemon self.assertTrue(2 < daemon.run_counter()) AssertionError: False is not true ---------------------------------------------------------------------- Bumping the test time to 0.2 to give it four times as long. In all the test runs I've done this is the first time for this to crop up so should be more than enough.
| * Dropping graph stats' get_color() methodDamian Johnson2014-09-21
| | | | | | | | | | | | | | | | Wonder why we had this. Graph panel had default colors, then the only place we overwrote it was the bandwidth stats with the exact same thing. Maybe it was to allow customization once upon a time. Anyway, dropping the unnecessary method.
| * Revising title stat handlingDamian Johnson2014-09-20
| | | | | | | | | | | | | | Not only tidying up the code a bit but addressing several issues (stacktrace due to accessing a NewDesc event attribute that didn't exist, didn't properly initialize attributes, no reason in including observed bandwidth if measured is available).
| * Taking advantage of get_effective_rate()Damian Johnson2014-09-20
| | | | | | | | Droping our helper function that got this.
| * Better handle bandwidth averagesDamian Johnson2014-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Arm was made in a time before 'GETINFO traffic/*'. In fact, I added those options just for arm. :) We had pretty odd handling for both the bandwidth total and average, properly tracking the former but only basing the later on the time we've been running. Proper behavior is... * Base the average on the whole duration tor's been running if we can get both the bandwidth totals and tor's uptime. * If not then base both the total and average on the time arm's running. This is not only more correct and intuitive, but leads to much simpler code since we don't need to track the prepopulated values separately. Dropping a couple helper functions while we're at it.
| * Taking advantage of str_tools.join()Damian Johnson2014-09-17
| | | | | | | | Couple bits we can nicely simplify with stem's new join() method.
| * Splitting get_header_label()Damian Johnson2014-09-16
| | | | | | | | | | | | | | We fetched both our primary and secondary headers via get_header_label() but on reflection it's cleaner to split these up. This improves the connection and resource stats, but couldn't be applied to the bandwidth stats since those are a convoluted mess. Fun.
| * Dropping graph stat's get_refresh_rate()Damian Johnson2014-09-16
| | | | | | | | | | | | Honestly not quite sure what this method is for. Stats provide a metric every second, and the panel shows results at various intervals. But this method simply prevented the connection stats from being redrawn more frequently...?
| * Revising ConnStatsDamian Johnson2014-09-16
| | | | | | | | | | | | | | | | | | Our connection stats didn't account for SETCONF of our ports. Also, this didn't check that ports were local and we can have multiple or/dir/control ports. Correcting all these issues by using stem's get_ports() method. Stem doesn't presently cache 'GETINFO net/listeners/*' lookups. We'll need to fix that later.
| * Revising ResourceStatsDamian Johnson2014-09-16
| | | | | | | | | | | | Just a little cleanup from earlier mass refactoring. We were fetching but not using tor's pid, set an unused run_count attribute, and registered zero cpu/memory if between tracker samplings.
| * Changing quote type used by graph panelDamian Johnson2014-09-15
| | | | | | | | | | | | Revising the bandwidth stats is getting tricky without taking a more wholistic view, so revising the quote types as a first step toward cleaning up the rest of this module.
| * Rewriting bandwidth stat's accounting handlingDamian Johnson2014-09-14
| | | | | | | | | | | | Taking advantage of stem's new get_accounting_stats() method, and overhauling how we render accounting information. We had three instance variables for this which was kinda silly.
| * Adding bandwidth_from_state() utilDamian Johnson2014-09-13
| | | | | | | | | | Moving the bulk of our function for prepopulating bandwidth information from the state file to our util, and adding tests for it.
| * Missing default for get_circuits() callDamian Johnson2014-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exception raised when quitting... Exception in thread Thread-4: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner self.run() File "/home/atagar/Desktop/arm/arm/connections/conn_panel.py", line 348, in run self._update() # populates initial entries File "/home/atagar/Desktop/arm/arm/connections/conn_panel.py", line 563, in _update if new_conn_line.get_type() != conn_entry.Category.CIRCUIT: File "/home/atagar/Desktop/arm/arm/connections/conn_entry.py", line 487, in get_type my_circuits = controller.get_circuits() File "/usr/lib/python2.7/stem/control.py", line 2287, in get_circuits raise exc SocketClosed
| * Static check issuesDamian Johnson2014-09-13
| | | | | | | | | | Few issues spotted by my netbook's version of pyflakes. Little surprised since it's older than my desktop...
| * Rewriting state file parsingDamian Johnson2014-09-10
| | | | | | | | | | | | | | | | | | | | Revising the part of prepopulate_from_state() that parses our state file. Most interesting bit is that we were doing a dumb method of converting a 'UTC timestamp => unix time'. We used mktime() which converted to localtime, then converted back. The calendar.timegm() function, however, does exactly what we want, as described in the table at the top of... https://docs.python.org/3.3/library/time.html
| * Changing prepopulate_from_state() to raise exceptionsDamian Johnson2014-09-10
| | | | | | | | | | | | Having prepopulate_from_state() raise upon issues, and return the seconds missing rather than a boolean indicating success. Both makes the function nicer, and lets us move the logging to the caller.
| * Lowering badwidth prepopulation logging issues to info runlevelDamian Johnson2014-09-08
| | | | | | | | | | | | Dropping the logging runlevel of these notifications, in addition to some minor tweaks to the function. If there's one thing folks on irc have taught me it's that anything we log will freak people out, no matter how innocuous.
| * Don't skip bandwidth graph prepopulation for non-relaysDamian Johnson2014-09-08
| | | | | | | | | | I'm not quite sure why we skipped it. Maybe the state file won't have the bandwidth entries? Probably no harm in checking anyway.
| * Replacing code for getting process uptimeDamian Johnson2014-09-08
| | | | | | | | | | | | We had a hack here where we got more attributes than we wanted to piggyback on cached values fetched for other things. That hack no longer works, and stem has a very nice function for this so using that.
| * Replacing the get_my_bandwidth_rate() and get_my_bandwidth_burst() helpersDamian Johnson2014-09-08
| | | | | | | | | | Couple legacy methods from our old torTools module. Replacing them with a simpler helper that does the trick.
| * Dropping get_my_bandwidth_observed() and get_my_bandwidth_measured()Damian Johnson2014-09-08
| | | | | | | | | | With the prior revisions these are now just two line helper functions. No reason to keep them separate any longer.
| * Moving bandwidth population strings to configDamian Johnson2014-09-08
| | | | | | | | | | Moving the strings out of the code, and making a new 'msg.panle.*' grouping for the panel content.
| * First pass revising bandwidth statsDamian Johnson2014-09-08
|/ | | | | | | | | | | | | Just made three changes on this pass... * Changed double quotes to single quotes. * Fixed a couple spots where we call GETCONF with a None default then immedately convert to an int (raising a TypeError if we ever failed the call). * Changed a couple spots where we got our own descriptor to be a lot simpler thanks to getattr().
* Rewriting the header panelDamian Johnson2014-09-08
|\ | | | | | | | | | | | | | | | | Honestly this isn't a true feature branch (many miscellaneous revisions have slipped in over time), but still it's a landmark. Done rewriting our first curses panel! before: https://gitweb.torproject.org/arm.git/blob/e249dc8f5c4c282326324161cf8421f947cf660e:/src/cli/headerPanel.py after: https://gitweb.torproject.org/arm.git/blob/HEAD:/arm/header_panel.py
| * First stab at reconnection supportDamian Johnson2014-09-08
| | | | | | | | | | | | | | | | | | | | This really shouldn't be hard. While writing Stem I took reconnectability into account from the beginning so it should be as simple as re-connecting and re-authenticating. However, something failing badly. Unfortunately this is proving tricky to troubleshoot so think I'm gonna move on for now, then loop back when more of arm is rewritten. Hopefully this will make investigating easier.