1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-21 23:55:17 -05:00

Compare commits

...

5 Commits

Author SHA1 Message Date
dependabot[bot]
3895786833
Merge 125ae6b97b into 4d1dfadbde 2024-05-08 00:03:34 +00:00
dependabot[bot]
125ae6b97b
Bump werkzeug from 3.0.2 to 3.0.3
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/werkzeug/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: werkzeug
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-08 00:03:31 +00:00
4d1dfadbde
Merge pull request #163 from craigerl/dependabot/pip/jinja2-3.1.4
Bump jinja2 from 3.1.3 to 3.1.4
2024-05-07 20:01:37 -04:00
93a9cce0c0 Put an upper bound on the QueueHandler queue
This patch overrides the base QueueHandler class
from logging to ensure that the queue doesn't grow
infinitely.  That can be a problem when there is
no consumer pulling items out of the queue.
the queue is now capped at 200 entries max.
2024-05-07 20:00:17 -04:00
dependabot[bot]
321260ff7a
Bump jinja2 from 3.1.3 to 3.1.4
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.3...3.1.4)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 20:55:03 +00:00
6 changed files with 403 additions and 148 deletions

View File

@ -4,6 +4,7 @@ CHANGES
v3.4.0 v3.4.0
------ ------
* Updated Changelog for 3.4.0
* Change setup.h * Change setup.h
* Fixed docker setup.sh comparison * Fixed docker setup.sh comparison
* Fixed unit tests failing with WatchList * Fixed unit tests failing with WatchList

View File

@ -12,7 +12,22 @@ from aprsd.conf import log as conf_log
CONF = cfg.CONF CONF = cfg.CONF
# LOG = logging.getLogger("APRSD") # LOG = logging.getLogger("APRSD")
LOG = logger LOG = logger
logging_queue = queue.Queue()
class QueueLatest(queue.Queue):
"""Custom Queue to keep only the latest N items.
This prevents the queue from blowing up in size.
"""
def put(self, *args, **kwargs):
try:
super().put(*args, **kwargs)
except queue.Full:
self.queue.popleft()
super().put(*args, **kwargs)
logging_queue = QueueLatest(maxsize=200)
class InterceptHandler(logging.Handler): class InterceptHandler(logging.Handler):
@ -59,6 +74,10 @@ def setup_logging(loglevel=None, quiet=False):
"werkzeug._internal", "werkzeug._internal",
"socketio", "socketio",
"urllib3.connectionpool", "urllib3.connectionpool",
"chardet",
"chardet.charsetgroupprober",
"chardet.eucjpprober",
"chardet.mbcharsetprober",
] ]
# We don't really want to see the aprslib parsing debug output. # We don't really want to see the aprslib parsing debug output.

View File

@ -5,6 +5,7 @@ from oslo_config import cfg
import aprsd import aprsd
from aprsd import utils from aprsd import utils
from aprsd.log import log as aprsd_log
CONF = cfg.CONF CONF = cfg.CONF
@ -32,6 +33,7 @@ class APRSDStats:
def stats(self, serializable=False) -> dict: def stats(self, serializable=False) -> dict:
current, peak = tracemalloc.get_traced_memory() current, peak = tracemalloc.get_traced_memory()
uptime = self.uptime() uptime = self.uptime()
qsize = aprsd_log.logging_queue.qsize()
if serializable: if serializable:
uptime = str(uptime) uptime = str(uptime)
stats = { stats = {
@ -42,5 +44,6 @@ class APRSDStats:
"memory_current_str": utils.human_size(current), "memory_current_str": utils.human_size(current),
"memory_peak": int(peak), "memory_peak": int(peak),
"memory_peak_str": utils.human_size(peak), "memory_peak_str": utils.human_size(peak),
"loging_queue": qsize,
} }
return stats return stats

View File

@ -6,6 +6,7 @@ import tracemalloc
from oslo_config import cfg from oslo_config import cfg
from aprsd import client, packets, utils from aprsd import client, packets, utils
from aprsd.log import log as aprsd_log
from aprsd.stats import collector from aprsd.stats import collector
from aprsd.threads import APRSDThread, APRSDThreadList from aprsd.threads import APRSDThread, APRSDThreadList
@ -59,7 +60,7 @@ class KeepAliveThread(APRSDThread):
keepalive = ( keepalive = (
"{} - Uptime {} RX:{} TX:{} Tracker:{} Msgs TX:{} RX:{} " "{} - Uptime {} RX:{} TX:{} Tracker:{} Msgs TX:{} RX:{} "
"Last:{} Email: {} - RAM Current:{} Peak:{} Threads:{}" "Last:{} Email: {} - RAM Current:{} Peak:{} Threads:{} LoggingQueue:{}"
).format( ).format(
stats_json["APRSDStats"]["callsign"], stats_json["APRSDStats"]["callsign"],
stats_json["APRSDStats"]["uptime"], stats_json["APRSDStats"]["uptime"],
@ -73,6 +74,7 @@ class KeepAliveThread(APRSDThread):
stats_json["APRSDStats"]["memory_current_str"], stats_json["APRSDStats"]["memory_current_str"],
stats_json["APRSDStats"]["memory_peak_str"], stats_json["APRSDStats"]["memory_peak_str"],
len(thread_list), len(thread_list),
aprsd_log.logging_queue.qsize(),
) )
LOG.info(keepalive) LOG.info(keepalive)
if "APRSDThreadList" in stats_json: if "APRSDThreadList" in stats_json:

View File

@ -4,79 +4,205 @@
# #
# pip-compile --annotation-style=line dev-requirements.in # pip-compile --annotation-style=line dev-requirements.in
# #
add-trailing-comma==3.1.0 # via gray add-trailing-comma==3.1.0
alabaster==0.7.16 # via sphinx # via gray
autoflake==1.5.3 # via gray alabaster==0.7.16
babel==2.14.0 # via sphinx # via sphinx
black==24.4.0 # via gray autoflake==1.5.3
build==1.2.1 # via pip-tools # via gray
cachetools==5.3.3 # via tox babel==2.14.0
certifi==2024.2.2 # via requests # via sphinx
cfgv==3.4.0 # via pre-commit black==24.4.0
chardet==5.2.0 # via tox # via gray
charset-normalizer==3.3.2 # via requests build==1.2.1
click==8.1.7 # via black, fixit, moreorless, pip-tools # via pip-tools
colorama==0.4.6 # via tox cachetools==5.3.3
commonmark==0.9.1 # via rich # via tox
configargparse==1.7 # via gray certifi==2024.2.2
coverage[toml]==7.5.0 # via pytest-cov # via requests
distlib==0.3.8 # via virtualenv cfgv==3.4.0
docutils==0.21.2 # via sphinx # via pre-commit
exceptiongroup==1.2.1 # via pytest chardet==5.2.0
filelock==3.13.4 # via tox, virtualenv # via tox
fixit==2.1.0 # via gray charset-normalizer==3.3.2
flake8==7.0.0 # via -r dev-requirements.in, pep8-naming # via requests
gray==0.14.0 # via -r dev-requirements.in click==8.1.7
identify==2.5.36 # via pre-commit # via
idna==3.7 # via requests # black
imagesize==1.4.1 # via sphinx # fixit
iniconfig==2.0.0 # via pytest # moreorless
isort==5.13.2 # via -r dev-requirements.in, gray # pip-tools
jinja2==3.1.3 # via sphinx colorama==0.4.6
libcst==1.3.1 # via fixit # via tox
markupsafe==2.1.5 # via jinja2 commonmark==0.9.1
mccabe==0.7.0 # via flake8 # via rich
moreorless==0.4.0 # via fixit configargparse==1.7
mypy==1.9.0 # via -r dev-requirements.in # via gray
mypy-extensions==1.0.0 # via black, mypy coverage[toml]==7.5.0
nodeenv==1.8.0 # via pre-commit # via pytest-cov
packaging==24.0 # via black, build, fixit, pyproject-api, pytest, sphinx, tox distlib==0.3.8
pathspec==0.12.1 # via black, trailrunner # via virtualenv
pep8-naming==0.13.3 # via -r dev-requirements.in docutils==0.21.2
pip-tools==7.4.1 # via -r dev-requirements.in # via sphinx
platformdirs==4.2.1 # via black, tox, virtualenv exceptiongroup==1.2.1
pluggy==1.5.0 # via pytest, tox # via pytest
pre-commit==3.7.0 # via -r dev-requirements.in filelock==3.13.4
pycodestyle==2.11.1 # via flake8 # via
pyflakes==3.2.0 # via autoflake, flake8 # tox
pygments==2.17.2 # via rich, sphinx # virtualenv
pyproject-api==1.6.1 # via tox fixit==2.1.0
pyproject-hooks==1.0.0 # via build, pip-tools # via gray
pytest==8.1.1 # via -r dev-requirements.in, pytest-cov flake8==7.0.0
pytest-cov==5.0.0 # via -r dev-requirements.in # via
pyupgrade==3.15.2 # via gray # -r dev-requirements.in
pyyaml==6.0.1 # via libcst, pre-commit # pep8-naming
requests==2.31.0 # via sphinx gray==0.14.0
rich==12.6.0 # via gray # via -r dev-requirements.in
snowballstemmer==2.2.0 # via sphinx identify==2.5.36
sphinx==7.3.7 # via -r dev-requirements.in # via pre-commit
sphinxcontrib-applehelp==1.0.8 # via sphinx idna==3.7
sphinxcontrib-devhelp==1.0.6 # via sphinx # via requests
sphinxcontrib-htmlhelp==2.0.5 # via sphinx imagesize==1.4.1
sphinxcontrib-jsmath==1.0.1 # via sphinx # via sphinx
sphinxcontrib-qthelp==1.0.7 # via sphinx iniconfig==2.0.0
sphinxcontrib-serializinghtml==1.1.10 # via sphinx # via pytest
tokenize-rt==5.2.0 # via add-trailing-comma, pyupgrade isort==5.13.2
toml==0.10.2 # via autoflake # via
tomli==2.0.1 # via black, build, coverage, fixit, mypy, pip-tools, pyproject-api, pyproject-hooks, pytest, sphinx, tox # -r dev-requirements.in
tox==4.14.2 # via -r dev-requirements.in # gray
trailrunner==1.4.0 # via fixit jinja2==3.1.4
typing-extensions==4.11.0 # via black, mypy # via sphinx
unify==0.5 # via gray libcst==1.3.1
untokenize==0.1.1 # via unify # via fixit
urllib3==2.2.1 # via requests markupsafe==2.1.5
virtualenv==20.26.0 # via pre-commit, tox # via jinja2
wheel==0.43.0 # via pip-tools mccabe==0.7.0
# via flake8
moreorless==0.4.0
# via fixit
mypy==1.9.0
# via -r dev-requirements.in
mypy-extensions==1.0.0
# via
# black
# mypy
nodeenv==1.8.0
# via pre-commit
packaging==24.0
# via
# black
# build
# fixit
# pyproject-api
# pytest
# sphinx
# tox
pathspec==0.12.1
# via
# black
# trailrunner
pep8-naming==0.13.3
# via -r dev-requirements.in
pip-tools==7.4.1
# via -r dev-requirements.in
platformdirs==4.2.1
# via
# black
# tox
# virtualenv
pluggy==1.5.0
# via
# pytest
# tox
pre-commit==3.7.0
# via -r dev-requirements.in
pycodestyle==2.11.1
# via flake8
pyflakes==3.2.0
# via
# autoflake
# flake8
pygments==2.17.2
# via
# rich
# sphinx
pyproject-api==1.6.1
# via tox
pyproject-hooks==1.0.0
# via
# build
# pip-tools
pytest==8.1.1
# via
# -r dev-requirements.in
# pytest-cov
pytest-cov==5.0.0
# via -r dev-requirements.in
pyupgrade==3.15.2
# via gray
pyyaml==6.0.1
# via
# libcst
# pre-commit
requests==2.31.0
# via sphinx
rich==12.6.0
# via gray
snowballstemmer==2.2.0
# via sphinx
sphinx==7.3.7
# via -r dev-requirements.in
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
tokenize-rt==5.2.0
# via
# add-trailing-comma
# pyupgrade
toml==0.10.2
# via autoflake
tomli==2.0.1
# via
# black
# build
# coverage
# fixit
# mypy
# pip-tools
# pyproject-api
# pyproject-hooks
# pytest
# sphinx
# tox
tox==4.14.2
# via -r dev-requirements.in
trailrunner==1.4.0
# via fixit
typing-extensions==4.11.0
# via
# black
# mypy
unify==0.5
# via gray
untokenize==0.1.1
# via unify
urllib3==2.2.1
# via requests
virtualenv==20.26.0
# via
# pre-commit
# tox
wheel==0.43.0
# via pip-tools
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
# pip # pip

View File

@ -4,79 +4,183 @@
# #
# pip-compile --annotation-style=line requirements.in # pip-compile --annotation-style=line requirements.in
# #
aprslib==0.7.2 # via -r requirements.in aprslib==0.7.2
attrs==23.2.0 # via -r requirements.in, ax253, kiss3, rush # via -r requirements.in
ax253==0.1.5.post1 # via kiss3 attrs==23.2.0
beautifulsoup4==4.12.3 # via -r requirements.in # via
bidict==0.23.1 # via python-socketio # -r requirements.in
bitarray==2.9.2 # via ax253, kiss3 # ax253
blinker==1.7.0 # via flask # kiss3
certifi==2024.2.2 # via requests # rush
charset-normalizer==3.3.2 # via requests ax253==0.1.5.post1
click==8.1.7 # via -r requirements.in, click-completion, click-params, flask # via kiss3
click-completion==0.5.2 # via -r requirements.in beautifulsoup4==4.12.3
click-params==0.5.0 # via -r requirements.in # via -r requirements.in
commonmark==0.9.1 # via rich bidict==0.23.1
dataclasses==0.6 # via -r requirements.in # via python-socketio
dataclasses-json==0.6.4 # via -r requirements.in bitarray==2.9.2
debtcollector==3.0.0 # via oslo-config # via
deprecated==1.2.14 # via click-params # ax253
dnspython==2.6.1 # via eventlet # kiss3
eventlet==0.36.1 # via -r requirements.in blinker==1.7.0
flask==3.0.3 # via -r requirements.in, flask-httpauth, flask-socketio # via flask
flask-httpauth==4.8.0 # via -r requirements.in certifi==2024.2.2
flask-socketio==5.3.6 # via -r requirements.in # via requests
geographiclib==2.0 # via geopy charset-normalizer==3.3.2
geopy==2.4.1 # via -r requirements.in # via requests
gevent==24.2.1 # via -r requirements.in click==8.1.7
greenlet==3.0.3 # via eventlet, gevent # via
h11==0.14.0 # via wsproto # -r requirements.in
idna==3.7 # via requests # click-params
imapclient==3.0.1 # via -r requirements.in # flask
importlib-metadata==7.1.0 # via ax253, kiss3 click-params==0.5.0
itsdangerous==2.2.0 # via flask # via -r requirements.in
jinja2==3.1.3 # via click-completion, flask commonmark==0.9.1
kiss3==8.0.0 # via -r requirements.in # via rich
loguru==0.7.2 # via -r requirements.in dataclasses==0.6
markupsafe==2.1.5 # via jinja2, werkzeug # via -r requirements.in
marshmallow==3.21.1 # via dataclasses-json dataclasses-json==0.6.4
mypy-extensions==1.0.0 # via typing-inspect # via -r requirements.in
netaddr==1.2.1 # via oslo-config debtcollector==3.0.0
oslo-config==9.4.0 # via -r requirements.in # via oslo-config
oslo-i18n==6.3.0 # via oslo-config deprecated==1.2.14
packaging==24.0 # via marshmallow # via click-params
pbr==6.0.0 # via -r requirements.in, oslo-i18n, stevedore dnspython==2.6.1
pluggy==1.5.0 # via -r requirements.in # via eventlet
pygments==2.17.2 # via rich eventlet==0.36.1
pyserial==3.5 # via pyserial-asyncio # via -r requirements.in
pyserial-asyncio==0.6 # via kiss3 flask==3.0.3
python-engineio==4.9.0 # via python-socketio # via
python-socketio==5.11.2 # via -r requirements.in, flask-socketio # -r requirements.in
pytz==2024.1 # via -r requirements.in # flask-httpauth
pyyaml==6.0.1 # via -r requirements.in, oslo-config # flask-socketio
requests==2.31.0 # via -r requirements.in, oslo-config, update-checker flask-httpauth==4.8.0
rfc3986==2.0.0 # via oslo-config # via -r requirements.in
rich==12.6.0 # via -r requirements.in flask-socketio==5.3.6
rush==2021.4.0 # via -r requirements.in # via -r requirements.in
shellingham==1.5.4 # via -r requirements.in, click-completion geographiclib==2.0
simple-websocket==1.0.0 # via python-engineio # via geopy
six==1.16.0 # via -r requirements.in, click-completion geopy==2.4.1
soupsieve==2.5 # via beautifulsoup4 # via -r requirements.in
stevedore==5.2.0 # via oslo-config gevent==24.2.1
tabulate==0.9.0 # via -r requirements.in # via -r requirements.in
thesmuggler==1.0.1 # via -r requirements.in greenlet==3.0.3
typing-extensions==4.11.0 # via typing-inspect # via
typing-inspect==0.9.0 # via dataclasses-json # eventlet
tzlocal==5.2 # via -r requirements.in # gevent
update-checker==0.18.0 # via -r requirements.in h11==0.14.0
urllib3==2.2.1 # via requests # via wsproto
validators==0.22.0 # via click-params idna==3.7
werkzeug==3.0.2 # via -r requirements.in, flask # via requests
wrapt==1.16.0 # via -r requirements.in, debtcollector, deprecated imapclient==3.0.1
wsproto==1.2.0 # via simple-websocket # via -r requirements.in
zipp==3.18.1 # via importlib-metadata importlib-metadata==7.1.0
zope-event==5.0 # via gevent # via
zope-interface==6.3 # via gevent # ax253
# kiss3
itsdangerous==2.2.0
# via flask
jinja2==3.1.4
# via flask
kiss3==8.0.0
# via -r requirements.in
loguru==0.7.2
# via -r requirements.in
markupsafe==2.1.5
# via
# jinja2
# werkzeug
marshmallow==3.21.1
# via dataclasses-json
mypy-extensions==1.0.0
# via typing-inspect
netaddr==1.2.1
# via oslo-config
oslo-config==9.4.0
# via -r requirements.in
oslo-i18n==6.3.0
# via oslo-config
packaging==24.0
# via marshmallow
pbr==6.0.0
# via
# -r requirements.in
# oslo-i18n
# stevedore
pluggy==1.5.0
# via -r requirements.in
pygments==2.17.2
# via rich
pyserial==3.5
# via pyserial-asyncio
pyserial-asyncio==0.6
# via kiss3
python-engineio==4.9.0
# via python-socketio
python-socketio==5.11.2
# via
# -r requirements.in
# flask-socketio
pytz==2024.1
# via -r requirements.in
pyyaml==6.0.1
# via
# -r requirements.in
# oslo-config
requests==2.31.0
# via
# -r requirements.in
# oslo-config
# update-checker
rfc3986==2.0.0
# via oslo-config
rich==12.6.0
# via -r requirements.in
rush==2021.4.0
# via -r requirements.in
shellingham==1.5.4
# via -r requirements.in
simple-websocket==1.0.0
# via python-engineio
six==1.16.0
# via -r requirements.in
soupsieve==2.5
# via beautifulsoup4
stevedore==5.2.0
# via oslo-config
tabulate==0.9.0
# via -r requirements.in
thesmuggler==1.0.1
# via -r requirements.in
typing-extensions==4.11.0
# via typing-inspect
typing-inspect==0.9.0
# via dataclasses-json
tzlocal==5.2
# via -r requirements.in
update-checker==0.18.0
# via -r requirements.in
urllib3==2.2.1
# via requests
validators==0.22.0
# via click-params
werkzeug==3.0.3
# via
# -r requirements.in
# flask
wrapt==1.16.0
# via
# -r requirements.in
# debtcollector
# deprecated
wsproto==1.2.0
# via simple-websocket
zipp==3.18.1
# via importlib-metadata
zope-event==5.0
# via gevent
zope-interface==6.3
# via gevent
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
# setuptools # setuptools