Skip to content
Snippets Groups Projects
  1. Jun 27, 2022
  2. Oct 29, 2020
    • Damian Johnson's avatar
      Replace references to a nyxrc · 319f1348
      Damian Johnson authored
      Back in our old 'arm' days users could configure us through a file at ~/.armrc.
      Nyx changed this location to ~/.nyx/config but continued to call it a 'nyxrc'.
      Caught thanks to Sai...
      
        https://github.com/torproject/nyx/pull/27
      
      Mostly this changes internal references, but there are two user visible
      changes...
      
        * This fixes our FAQ which incorrectly said that we read from ~/.nyx/nyxrc.
      
        * Removes the sample nyxrc path from our man page. Our setup.py no longer
          installs such a file.
      
      This intentionally keeps two references to a nyxrc...
      
        * Our website's url for a sample is...
      
            https://nyx.torproject.org/nyxrc.sample
      
          We can't change this prior to our next release without confusing users.
      
        * Our legacy changelog entries still call it a nyxrc because that's what it
          was called back then.
      319f1348
  3. Oct 28, 2020
    • Damian Johnson's avatar
      Fix unit tests · 3ea784a3
      Damian Johnson authored
      I don't run Nyx's unit tests very often so a few regressions slipped in. Some
      due to Nyx adjustments, some from Stem.
      
      Stem renamed its is_pep8_available() function to
      is_pycodestyle_available() because the upstream project renamed itself...
      
        Traceback (most recent call last):
          File "./run_tests.py", line 80, in <module>
            main()
          File "/home/atagar/Desktop/nyx/stem/util/conf.py", line 289, in wrapped
            return func(*args, **kwargs)
          File "./run_tests.py", line 46, in main
            if stem.util.test_tools.is_pep8_available():
        AttributeError: module 'stem.util.test_tools' has no attribute 'is_pep8_available'
      3ea784a3
  4. Dec 21, 2019
  5. Jan 12, 2019
    • Damian Johnson's avatar
      Fix python 3.x test regression · 33787ee7
      Damian Johnson authored
      Oops, my recent change to skip the installation test when offline broke
      python3...
      
        ======================================================================
        ERROR: installation (unittest.loader._FailedTest)
        ----------------------------------------------------------------------
        ImportError: Failed to import test module: installation
        Traceback (most recent call last):
          File "/usr/lib/python3.5/unittest/loader.py", line 428, in _find_test_path
            module = self._get_module_from_name(name)
          File "/usr/lib/python3.5/unittest/loader.py", line 369, in _get_module_from_name
            __import__(name)
          File "/home/atagar/Desktop/nyx/test/installation.py", line 6, in <module>
            import urllib2
        ImportError: No module named 'urllib2'
      33787ee7
  6. Jan 10, 2019
    • Damian Johnson's avatar
      Skip installation test when offline · 55854cdb
      Damian Johnson authored
      On my morning bus commute I was pretty puzzled why our tests broke. Turns out
      we fail in a rather confusing way that says our PYTHONPATH is misconfigured
      when unable to install stem from pypi.
      55854cdb
    • Damian Johnson's avatar
      Fix interpreter panel unit tests · 7c203455
      Damian Johnson authored
      Oops, line wrapping broke our tests...
      
        ======================================================================
        FAIL: test_multiline_panel (panel.interpreter.TestInterpreter)
        ----------------------------------------------------------------------
        Traceback (most recent call last):
          File "/home/atagar/Desktop/nyx/test/__init__.py", line 59, in wrapped
            return func(self, *args, **kwargs)
          File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
            return func(*args, **keywargs)
          File "/home/atagar/Desktop/nyx/test/panel/interpreter.py", line 107, in test_multiline_panel
            self.assertEqual(EXPECTED_MULTILINE_PANEL, test.render(panel._draw).content)
        AssertionError: 'Control Interpreter:\n>>> GETINFO version\n250-version=0.2.4.27 (git-412e3f7dc9c6c01a)\n>>> to use this panel press enter' != u'Control Interpreter:\n>>> to use this panel press enter'
      
        ======================================================================
        FAIL: test_scrollbar (panel.interpreter.TestInterpreter)
        ----------------------------------------------------------------------
        Traceback (most recent call last):
          File "/home/atagar/Desktop/nyx/test/__init__.py", line 59, in wrapped
            return func(self, *args, **kwargs)
          File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
            return func(*args, **keywargs)
          File "/home/atagar/Desktop/nyx/test/panel/interpreter.py", line 120, in test_scrollbar
            self.assertEqual(EXPECTED_WITH_SCROLLBAR, test.render(panel._draw).content)
        AssertionError: 'Control Interpreter:\n |>>> GETINFO version\n |250-version=0.2.4.27 (git-412e3f7dc9c6c01a)\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n |\n-+' != u'Control Interpreter:\n>>> to use this panel press enter'
      
        ----------------------------------------------------------------------
      
      With commit 75052e8d tests should no longer directly modify their private
      '_lines' attribute. We need to call the _add_line() helper instead to ensure
      the wrapped and unwrapped attributes stay in sync.
      7c203455
  7. Jan 03, 2019
  8. Apr 18, 2018
  9. Nov 11, 2017
  10. Nov 10, 2017
  11. Nov 06, 2017
    • Damian Johnson's avatar
      Switch installation to setuptools · b89f6ca3
      Damian Johnson authored
      Got additional testers on #tor-dev and turns out our custom installer causes it
      to fail for just about everybody. Dropping the ability to specify a man or
      samplerc path to get us back on the road best traveled. Also swapping from
      distutil to setuptools so we have entry_points (which we need for a bin
      script).
  12. Nov 04, 2017
  13. Nov 03, 2017
  14. Oct 30, 2017
  15. Oct 26, 2017
  16. Oct 24, 2017
    • Damian Johnson's avatar
      Fix unit tests · c6c16ebc
      Damian Johnson authored
      Lots of breakages have slipped in while attempting to improve our performance.
      Most were timing related due to our switch to static sleeps.
      c6c16ebc
  17. Sep 22, 2017
    • Damian Johnson's avatar
      Make deduplication a constant time operation · 4acc68d5
      Damian Johnson authored
      At only INFO runlevel cpu usage on my relay jumps from 13% to 20%. This is
      entirely coming from deduplication. We made this far more efficient (linear
      from n^2) but it's pretty easy to finish dropping this down to a constant
      time operation.
      4acc68d5
  18. Sep 16, 2017
    • Damian Johnson's avatar
      Reduce graph panel cpu usage · c02be3ee
      Damian Johnson authored
      Our graph panel updates and redraws itself every second, making it a
      non-trivial load on cpu. Two actions in particular account for most of
      it...
      
        * Cloning stats on every redraw. This constantly consumes 0.3% cpu on my
          relay. Being lock-free is nice, but in this case a lock really makes
          sense.
      
        * Performing a flurry of addstr calls for each cell in the graph. Doing
          a single vline call for each column instead drops cpu by another 0.4%.
      
      On my relay this drops cpu usage of the graph panel from 1% to 0.4% (60%
      less)...
      
        * 0.3% cpu usage when only the header panel is rendered
        * 1.3% cpu usage when the graph panel was rendered too
        * 0.7% cpu usage when the graph panel was rendered with these changes
      c02be3ee
  19. Sep 10, 2017
  20. Sep 08, 2017
  21. Sep 05, 2017
  22. Sep 03, 2017
  23. Sep 01, 2017
    • Damian Johnson's avatar
      Implement relay cache · 8ea32382
      Damian Johnson authored
      There, that's more like what I was after. Adding methods to read and write
      relay data to the cache along with tests.
      8ea32382
  24. Aug 31, 2017
  25. Aug 30, 2017
  26. Aug 28, 2017
    • Damian Johnson's avatar
      Add cache helper · e9fbe443
      Damian Johnson authored
      Simple helper that provides back a sqlite cache for us to use. If we can
      persist it then great, if not then it resides in memory.
      e9fbe443
  27. Aug 27, 2017
    • Damian Johnson's avatar
      Fetch manual information on demand · 32b44dc3
      Damian Johnson authored
      Fetching just the manual information we need, when we need it. Rather than
      loading the whole manual this now retrieves information from the sqlite manual
      cache. This should mean slightly faster startup and reduced memory usage.
      However, this no longer parses the local man page (so information cannot be
      more up-to-date than stem's cache).
      
      We can re-introduce usage of local man pages later if this becomes something
      folks care about.
      32b44dc3
  28. Aug 15, 2017
    • Damian Johnson's avatar
      Fix log's date dividers · f974afcc
      Damian Johnson authored
      Our date bounding box was placed in the completely wrong spot (inverted x/y
      coordinates), and the side border vanished in the top wasn't visible.
      f974afcc
  29. Aug 13, 2017
    • Damian Johnson's avatar
      Cache our router status entry · 769ab42c
      Damian Johnson authored
      Both our header and graph frequenly refer to our router status entry. In
      practice this only changes once per hour so caching it for five minutes. At
      debug runlevel this causes the vast majority of the noise in our logs.
      769ab42c
    • Damian Johnson's avatar
      Fix installation and tests · 9f288129
      Damian Johnson authored
      Oops! Could've sworn I ran our tests after our earlier changes but evidently
      not. Moving our nyxrc.sample broke installation, and swapping to bytes broke
      some test assertions.
      9f288129
  30. Aug 09, 2017
    • Damian Johnson's avatar
      Scrollbars never reached bottom · 0aa4dcb6
      Damian Johnson authored
      Damn the scrollbars have been a bigger headache than anything else thus far.
      There was an off-by-one error where we compared the number of scroll elements
      to the last index.
      0aa4dcb6
    • Damian Johnson's avatar
      Pycodestyle compliance issues · 915b4d5f
      Damian Johnson authored
      Newer version of pycodestyle does some additional validation. Some aren't
      issues we're concerned with.
      915b4d5f
  31. Nov 27, 2016
    • Damian Johnson's avatar
      Fix slider math · dabcc36b
      Damian Johnson authored
      Damn this scrollbar method has given me a lot of headaches. Correcting an
      off-by-one error that caused the tests to fail on my netbook but pass on my
      pc.
      
      I really hope this is the last time I need to weed one of these out. For my
      personal reference here's the numbers when working through the test...
      
        top = 15
        top_index = 21
        size = 30
        self.height = 25
      
        scrollbar_height = self.height - top - 1 = 25 - 15 - 1 = 9
      
        bottom_index = top_index + scrollbar_height = 21 + 9 = 30
      
        slider_top = (scrollbar_height * top_index) // size = (9 * 21) // 30 = 6
        slider_size = (scrollbar_height * (bottom_index - top_index + 1)) // size = (9 * (30 - 21 + 1)) // 30 = 3
      dabcc36b
Loading