mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-23 23:48:11 +08:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ff834b794 | ||
|
|
2fe20033e3 | ||
|
|
1537872bf2 | ||
|
|
c9020ce94e | ||
|
|
5597d7ccd8 |
@@ -27,34 +27,19 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version:
|
python-version:
|
||||||
- "3.9"
|
|
||||||
- "3.10"
|
- "3.10"
|
||||||
- "3.11"
|
- "3.11"
|
||||||
- "3.12"
|
- "3.12"
|
||||||
|
- "3.13"
|
||||||
|
- "3.14"
|
||||||
django:
|
django:
|
||||||
- "4.2"
|
|
||||||
- "5.0"
|
|
||||||
- "5.1"
|
|
||||||
- "5.2"
|
- "5.2"
|
||||||
- "6.0"
|
- "6.0"
|
||||||
exclude:
|
exclude:
|
||||||
# django 5.2 does not support 3.9
|
# django 6 does not support 3.10
|
||||||
- python-version: "3.9"
|
|
||||||
django: "5.2"
|
|
||||||
# django 5.1 does not support 3.9
|
|
||||||
- python-version: "3.9"
|
|
||||||
django: "5.1"
|
|
||||||
# django 5.0 does not support 3.9
|
|
||||||
- python-version: "3.9"
|
|
||||||
django: "5.0"
|
|
||||||
# django 4.2 does not support 3.13
|
|
||||||
- python-version: "3.13"
|
|
||||||
django: "4.2"
|
|
||||||
# django 6.0 does not support earlier than 3.12
|
|
||||||
- python-version: "3.9"
|
|
||||||
django: "6.0"
|
|
||||||
- python-version: "3.10"
|
- python-version: "3.10"
|
||||||
django: "6.0"
|
django: "6.0"
|
||||||
|
# django 6 does not support 3.11
|
||||||
- python-version: "3.11"
|
- python-version: "3.11"
|
||||||
django: "6.0"
|
django: "6.0"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
# Sets the python version
|
# Sets the python version
|
||||||
FROM python:3.9-slim-bookworm
|
FROM python:3.12-slim-bookworm
|
||||||
|
|
||||||
# Allows the logs generated by python apps to be rendered in the terminal
|
# Allows the logs generated by python apps to be rendered in the terminal
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|||||||
+3
-3
@@ -35,13 +35,13 @@ See the `changelog <https://github.com/GDay/django-q2/blob/master/CHANGELOG.md>`
|
|||||||
Requirements
|
Requirements
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
- `Django <https://www.djangoproject.com>`__ > = 4.2
|
- `Django <https://www.djangoproject.com>`__ 5.2 and 6.0
|
||||||
- `Django-picklefield <https://github.com/gintas/django-picklefield>`__
|
- `Django-picklefield <https://github.com/gintas/django-picklefield>`__
|
||||||
|
|
||||||
Tested with:
|
Tested with:
|
||||||
|
|
||||||
* Python 3.9 to 3.13.
|
* Python 3.10 to 3.14.
|
||||||
* Django 4.2 to 6.0.
|
* Django 5.2 and 6.0.
|
||||||
|
|
||||||
Brokers
|
Brokers
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ def monitor(run_once=False, broker=None):
|
|||||||
for stat in stats:
|
for stat in stats:
|
||||||
status = stat.status
|
status = stat.status
|
||||||
# color status
|
# color status
|
||||||
|
if stat.status == Conf.STARTING:
|
||||||
|
status = term.yellow(str(Conf.STARTING))
|
||||||
if stat.status == Conf.WORKING:
|
if stat.status == Conf.WORKING:
|
||||||
status = term.green(str(Conf.WORKING))
|
status = term.green(str(Conf.WORKING))
|
||||||
elif stat.status == Conf.STOPPING:
|
elif stat.status == Conf.STOPPING:
|
||||||
@@ -105,6 +107,8 @@ def monitor(run_once=False, broker=None):
|
|||||||
status = term.red(str(Conf.STOPPED))
|
status = term.red(str(Conf.STOPPED))
|
||||||
elif stat.status == Conf.IDLE:
|
elif stat.status == Conf.IDLE:
|
||||||
status = str(Conf.IDLE)
|
status = str(Conf.IDLE)
|
||||||
|
else:
|
||||||
|
status = _("Unknown")
|
||||||
# color q's
|
# color q's
|
||||||
tasks = str(stat.task_q_size)
|
tasks = str(stat.task_q_size)
|
||||||
if stat.task_q_size > 0:
|
if stat.task_q_size > 0:
|
||||||
@@ -138,7 +142,7 @@ def monitor(run_once=False, broker=None):
|
|||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
term.move(i, 3 * col_width)
|
term.move(i, 3 * col_width)
|
||||||
+ term.center(workers, width=col_width - 1)
|
+ term.center(str(workers), width=col_width - 1)
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
term.move(i, 4 * col_width)
|
term.move(i, 4 * col_width)
|
||||||
@@ -146,11 +150,11 @@ def monitor(run_once=False, broker=None):
|
|||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
term.move(i, 5 * col_width)
|
term.move(i, 5 * col_width)
|
||||||
+ term.center(results, width=col_width - 1)
|
+ term.center(str(results), width=col_width - 1)
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
term.move(i, 6 * col_width)
|
term.move(i, 6 * col_width)
|
||||||
+ term.center(stat.reincarnations, width=col_width - 1)
|
+ term.center(str(stat.reincarnations), width=col_width - 1)
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
term.move(i, 7 * col_width)
|
term.move(i, 7 * col_width)
|
||||||
@@ -411,27 +415,27 @@ def memory(run_once=False, workers=False, broker=None):
|
|||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
term.move(row, 2 * col_width)
|
term.move(row, 2 * col_width)
|
||||||
+ term.center(memory_available_percentage, width=col_width - 1)
|
+ term.center(str(memory_available_percentage), width=col_width - 1)
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
term.move(row, 3 * col_width)
|
term.move(row, 3 * col_width)
|
||||||
+ term.center(memory_available, width=col_width - 1)
|
+ term.center(str(memory_available), width=col_width - 1)
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
term.move(row, 4 * col_width)
|
term.move(row, 4 * col_width)
|
||||||
+ term.center(
|
+ term.center(
|
||||||
round(psutil.virtual_memory().total / 1024**2, 2),
|
str(round(psutil.virtual_memory().total / 1024**2, 2)),
|
||||||
width=col_width - 1,
|
width=col_width - 1,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
term.move(row, 5 * col_width)
|
term.move(row, 5 * col_width)
|
||||||
+ term.center(get_process_mb(stat.sentinel), width=col_width - 1)
|
+ term.center(str(get_process_mb(stat.sentinel)), width=col_width - 1)
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
term.move(row, 6 * col_width)
|
term.move(row, 6 * col_width)
|
||||||
+ term.center(
|
+ term.center(
|
||||||
get_process_mb(getattr(stat, "monitor", None)),
|
str(get_process_mb(getattr(stat, "monitor", None))),
|
||||||
width=col_width - 1,
|
width=col_width - 1,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -444,7 +448,7 @@ def memory(run_once=False, workers=False, broker=None):
|
|||||||
print(
|
print(
|
||||||
term.move(row, 7 * col_width)
|
term.move(row, 7 * col_width)
|
||||||
+ term.center(
|
+ term.center(
|
||||||
workers_mb or "NO_PROCESSES_FOUND", width=col_width - 1
|
str(workers_mb) or "NO_PROCESSES_FOUND", width=col_width - 1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
row += 1
|
row += 1
|
||||||
@@ -476,7 +480,7 @@ def memory(run_once=False, workers=False, broker=None):
|
|||||||
mb_used = get_process_mb(worker_pid)
|
mb_used = get_process_mb(worker_pid)
|
||||||
print(
|
print(
|
||||||
term.move(row, (idx + 1) * col_width)
|
term.move(row, (idx + 1) * col_width)
|
||||||
+ term.center(mb_used, width=col_width - 1)
|
+ term.center(str(mb_used), width=col_width - 1)
|
||||||
)
|
)
|
||||||
row += 1
|
row += 1
|
||||||
row += 1
|
row += 1
|
||||||
|
|||||||
Generated
+853
-794
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -52,8 +52,8 @@ include = [
|
|||||||
|
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = ">=3.9,<4"
|
python = ">=3.10,<4"
|
||||||
django = ">=4.2"
|
django = ">=5.2"
|
||||||
django-picklefield = "^3.1"
|
django-picklefield = "^3.1"
|
||||||
|
|
||||||
blessed = { version = "^1.19.1", optional = true }
|
blessed = { version = "^1.19.1", optional = true }
|
||||||
|
|||||||
Reference in New Issue
Block a user