1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-25 09:28:38 -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 227 additions and 76 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

@ -80,7 +80,7 @@ importlib-metadata==7.1.0
# kiss3 # kiss3
itsdangerous==2.2.0 itsdangerous==2.2.0
# via flask # via flask
jinja2==3.1.3 jinja2==3.1.4
# via flask # via flask
kiss3==8.0.0 kiss3==8.0.0
# via -r requirements.in # via -r requirements.in