| Commit message (Collapse) | Author | Age |
| ... | |
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
The old name was confusing since we have a Stats class for the stats behind a
single graph.
|
| | |
| |
| |
| | |
No longer used, yet another little tidbit we can get rid of.
|
| | |
| |
| |
| |
| | |
Once upon a time it was really meaty but it's now just two lines of code. Not
worth a helper just for that.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
No need for these to be delegated to a method. All stats behave in the same
way.
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
This lets us drop custom draw handling from the stats class.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
Simply moving a constant from the graph panel to the config.
|
| | |
| |
| |
| |
| | |
Our graph panel's whole draw method was wrapped in a conditional. Minor tweak
so we can unindent the whole method.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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()
|
| | |
| |
| |
| | |
Method's completely unused, so easy one to drop.
|
| | |
| |
| |
| |
| | |
I keep swapping between dics, named tuples, and standalone classes for this.
Think this is the best option I've come up with yet.
|
| | |
| |
| |
| | |
Just a couple minor tweaks to make things a little less unnecessarily verbose.
|
| | |
| |
| |
| |
| |
| | |
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).
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| | |
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).
|
| | |
| |
| |
| | |
Droping our helper function that got this.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
Couple bits we can nicely simplify with stem's new join() method.
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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...?
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
Moving the bulk of our function for prepopulating bandwidth information from
the state file to our util, and adding tests for it.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| | |
Few issues spotted by my netbook's version of pyflakes. Little surprised since
it's older than my desktop...
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
Couple legacy methods from our old torTools module. Replacing them with a
simpler helper that does the trick.
|
| | |
| |
| |
| |
| | |
With the prior revisions these are now just two line helper functions. No
reason to keep them separate any longer.
|
| | |
| |
| |
| |
| | |
Moving the strings out of the code, and making a new 'msg.panle.*' grouping for
the panel content.
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
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().
|
| |\
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|