vortex-cli 8.3.0__tar.gz → 8.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/PKG-INFO +25 -4
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/README.md +24 -3
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/pyproject.toml +1 -1
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/stats.py +70 -10
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/webdesign.py +24 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex_cli.egg-info/PKG-INFO +25 -4
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/LICENSE +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/setup.cfg +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/__init__.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/__main__.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/cli.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/colour.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/__init__.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/agenda.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/app.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/clean.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/clone.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/code.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/compile.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/db.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/diff.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/docs.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/execute.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/fetch.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/file.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/info.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/keyword.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/libs.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/log.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/object_.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/pull.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/search.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/servers.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/use.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/watch.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/commands/weblog.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/constants.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/docs/Blackbook v2.md +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/docs/Blackbook.pdf +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/docs/index.html +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/docs/marked.min.js +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/git.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/lib/puakma-6.0.40.jar +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/libs.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/logging.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/main.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/models.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/output.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/registry.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/schedule.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/server_options.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/soap.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/spinner.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/sync.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/util.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex/workspace.py +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex_cli.egg-info/SOURCES.txt +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex_cli.egg-info/dependency_links.txt +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex_cli.egg-info/entry_points.txt +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex_cli.egg-info/requires.txt +0 -0
- {vortex_cli-8.3.0 → vortex_cli-8.4.0}/vortex_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vortex_cli
|
|
3
|
-
Version: 8.
|
|
3
|
+
Version: 8.4.0
|
|
4
4
|
Summary: Vortex CLI
|
|
5
5
|
Author-email: Jordan Amos <jordan.amos@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -106,6 +106,14 @@ While it is possible to use without it, this software has been purposefully desi
|
|
|
106
106
|
java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
## Upgrading to 8.4
|
|
110
|
+
|
|
111
|
+
- **`vortex stats` shows the server's disk space** after the statistics: each mounted local
|
|
112
|
+
filesystem's size, used and available space and Use%, as `df -h` shows them, with the
|
|
113
|
+
Puakma root's disk marked (see [Server statistics](#server-statistics)); `--json` adds them
|
|
114
|
+
as `disks`. It needs vortex/gateway 0.3.0, which adds them to `GET stats`; with an older
|
|
115
|
+
gateway the overview says so in one line.
|
|
116
|
+
|
|
109
117
|
## Upgrading to 8.3
|
|
110
118
|
|
|
111
119
|
- **`vortex weblog`** reads the server's HTTP access log (`HTTPTextLog`) through the gateway:
|
|
@@ -579,7 +587,8 @@ vortex weblog -k -n 0 only lines written from now on
|
|
|
579
587
|
|
|
580
588
|
`vortex stats` is a health check from the terminal: the time series each loaded addin keeps
|
|
581
589
|
in memory (the admin app's performance chart), through the gateway's `GET stats`
|
|
582
|
-
(`GatewaySystem`). One request per run, one row per statistic
|
|
590
|
+
(`GatewaySystem`), then the server's disk space. One request per run, one row per statistic
|
|
591
|
+
and per disk:
|
|
583
592
|
|
|
584
593
|
```
|
|
585
594
|
$ vortex stats -s dev
|
|
@@ -593,6 +602,10 @@ http.bytesouttotal 83.1M
|
|
|
593
602
|
http.hitsperminute 27 13 22.2 176 61m ▁▁▂▁▆▃▁▁▁▁▁▂▁▁█▁▁▅▅▅
|
|
594
603
|
...
|
|
595
604
|
|
|
605
|
+
Disk Size Used Avail Use% Type
|
|
606
|
+
--------------------- ------ ------ ------- ------ ------
|
|
607
|
+
/puakma (Puakma root) 24G 17G 7.3G 70% ext4
|
|
608
|
+
|
|
596
609
|
vortex stats --addin HTTP one addin (a short name, or its class name)
|
|
597
610
|
vortex stats --key stats.cpuusageperminute
|
|
598
611
|
vortex stats -k poll every 5 seconds and reprint (^C stops)
|
|
@@ -606,13 +619,21 @@ vortex stats -k poll every 5 seconds and reprint (^C stops)
|
|
|
606
619
|
- **In memory only.** The server keeps a limited window (about the last hour of a
|
|
607
620
|
per-minute statistic) and starts again on a restart, so a short `Span` means a recent
|
|
608
621
|
restart.
|
|
622
|
+
- **Disks** (gateway 0.3.0). Every mounted local filesystem the server's JVM sees, read when
|
|
623
|
+
the request is answered, as `df -h` shows them: `Used` is size minus free, `Avail` what a
|
|
624
|
+
non-root user can still write, `Use%` used / (used + avail). The disk holding the Puakma
|
|
625
|
+
root is marked. One disk seen through several mounts (a container's overlay root over its
|
|
626
|
+
host disk) is listed once; memory, kernel, read-only and network filesystems are left out.
|
|
627
|
+
No history - the gateway keeps none. `--addin` and `--key` narrow the request to statistics,
|
|
628
|
+
so they show no disks; an older gateway sends none, which the overview says once.
|
|
609
629
|
- **`-k`** re-polls every `-d` seconds (default 5) and reprints, clearing the screen when the
|
|
610
630
|
output is a terminal.
|
|
611
631
|
- **`--json`**: `data` is the addins as the gateway sends them, every key present -
|
|
612
632
|
`[{name, class, statistics: [{key, captureType, created, lastUpdated, entries: [{from, to,
|
|
613
633
|
value}]}]}]` (`captureType`: `once`, `per-second`, `per-minute`, `per-hour`, `per-day`; a
|
|
614
|
-
`once` entry has no `from`/`to`) - and `time` (the server's clock) beside it
|
|
615
|
-
|
|
634
|
+
`once` entry has no `from`/`to`) - and `time` (the server's clock) beside it, and `disks`
|
|
635
|
+
when the gateway sent them (`[{mount, name, type, totalBytes, usableBytes, freeBytes,
|
|
636
|
+
usedPct, puakmaRoot}]`). With `-k`, one envelope per poll, one per line.
|
|
616
637
|
- **Refusals.** `NOT_FOUND`: no addin of that name is loaded (`vortex stats` lists them).
|
|
617
638
|
`NOT_EXPOSED`: the gateway predates `GET stats` - update `vortex/gateway`. A blank
|
|
618
639
|
`gateway_path` is refused before anything is sent.
|
|
@@ -62,6 +62,14 @@ While it is possible to use without it, this software has been purposefully desi
|
|
|
62
62
|
java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
+
## Upgrading to 8.4
|
|
66
|
+
|
|
67
|
+
- **`vortex stats` shows the server's disk space** after the statistics: each mounted local
|
|
68
|
+
filesystem's size, used and available space and Use%, as `df -h` shows them, with the
|
|
69
|
+
Puakma root's disk marked (see [Server statistics](#server-statistics)); `--json` adds them
|
|
70
|
+
as `disks`. It needs vortex/gateway 0.3.0, which adds them to `GET stats`; with an older
|
|
71
|
+
gateway the overview says so in one line.
|
|
72
|
+
|
|
65
73
|
## Upgrading to 8.3
|
|
66
74
|
|
|
67
75
|
- **`vortex weblog`** reads the server's HTTP access log (`HTTPTextLog`) through the gateway:
|
|
@@ -535,7 +543,8 @@ vortex weblog -k -n 0 only lines written from now on
|
|
|
535
543
|
|
|
536
544
|
`vortex stats` is a health check from the terminal: the time series each loaded addin keeps
|
|
537
545
|
in memory (the admin app's performance chart), through the gateway's `GET stats`
|
|
538
|
-
(`GatewaySystem`). One request per run, one row per statistic
|
|
546
|
+
(`GatewaySystem`), then the server's disk space. One request per run, one row per statistic
|
|
547
|
+
and per disk:
|
|
539
548
|
|
|
540
549
|
```
|
|
541
550
|
$ vortex stats -s dev
|
|
@@ -549,6 +558,10 @@ http.bytesouttotal 83.1M
|
|
|
549
558
|
http.hitsperminute 27 13 22.2 176 61m ▁▁▂▁▆▃▁▁▁▁▁▂▁▁█▁▁▅▅▅
|
|
550
559
|
...
|
|
551
560
|
|
|
561
|
+
Disk Size Used Avail Use% Type
|
|
562
|
+
--------------------- ------ ------ ------- ------ ------
|
|
563
|
+
/puakma (Puakma root) 24G 17G 7.3G 70% ext4
|
|
564
|
+
|
|
552
565
|
vortex stats --addin HTTP one addin (a short name, or its class name)
|
|
553
566
|
vortex stats --key stats.cpuusageperminute
|
|
554
567
|
vortex stats -k poll every 5 seconds and reprint (^C stops)
|
|
@@ -562,13 +575,21 @@ vortex stats -k poll every 5 seconds and reprint (^C stops)
|
|
|
562
575
|
- **In memory only.** The server keeps a limited window (about the last hour of a
|
|
563
576
|
per-minute statistic) and starts again on a restart, so a short `Span` means a recent
|
|
564
577
|
restart.
|
|
578
|
+
- **Disks** (gateway 0.3.0). Every mounted local filesystem the server's JVM sees, read when
|
|
579
|
+
the request is answered, as `df -h` shows them: `Used` is size minus free, `Avail` what a
|
|
580
|
+
non-root user can still write, `Use%` used / (used + avail). The disk holding the Puakma
|
|
581
|
+
root is marked. One disk seen through several mounts (a container's overlay root over its
|
|
582
|
+
host disk) is listed once; memory, kernel, read-only and network filesystems are left out.
|
|
583
|
+
No history - the gateway keeps none. `--addin` and `--key` narrow the request to statistics,
|
|
584
|
+
so they show no disks; an older gateway sends none, which the overview says once.
|
|
565
585
|
- **`-k`** re-polls every `-d` seconds (default 5) and reprints, clearing the screen when the
|
|
566
586
|
output is a terminal.
|
|
567
587
|
- **`--json`**: `data` is the addins as the gateway sends them, every key present -
|
|
568
588
|
`[{name, class, statistics: [{key, captureType, created, lastUpdated, entries: [{from, to,
|
|
569
589
|
value}]}]}]` (`captureType`: `once`, `per-second`, `per-minute`, `per-hour`, `per-day`; a
|
|
570
|
-
`once` entry has no `from`/`to`) - and `time` (the server's clock) beside it
|
|
571
|
-
|
|
590
|
+
`once` entry has no `from`/`to`) - and `time` (the server's clock) beside it, and `disks`
|
|
591
|
+
when the gateway sent them (`[{mount, name, type, totalBytes, usableBytes, freeBytes,
|
|
592
|
+
usedPct, puakmaRoot}]`). With `-k`, one envelope per poll, one per line.
|
|
572
593
|
- **Refusals.** `NOT_FOUND`: no addin of that name is loaded (`vortex stats` lists them).
|
|
573
594
|
`NOT_EXPOSED`: the gateway predates `GET stats` - update `vortex/gateway`. A blank
|
|
574
595
|
`gateway_path` is refused before anything is sent.
|
|
@@ -7,11 +7,15 @@ admin app's performance chart (CPU, memory, threads, errors, logins, HTTP
|
|
|
7
7
|
hits and bytes, agenda actions, mail). One row per statistic: its value
|
|
8
8
|
now (the period still filling), the min/avg/max over the periods that
|
|
9
9
|
have ended, how far back the series goes, and a sparkline of its last
|
|
10
|
-
points.
|
|
10
|
+
points. Then the server's disks: each mounted filesystem's size, used
|
|
11
|
+
and available space and Use% (as df shows them), the Puakma root's
|
|
12
|
+
marked - a gateway older than 0.3.0 sends none.
|
|
11
13
|
|
|
12
14
|
--json: one envelope whose data is the addins - [{name, class,
|
|
13
15
|
statistics: [{key, captureType, created, lastUpdated, entries: [{from,
|
|
14
|
-
to, value}]}]}] - with the server's time beside it ("time")
|
|
16
|
+
to, value}]}]}] - with the server's time beside it ("time") and, when
|
|
17
|
+
the gateway sent them, the disks ("disks": [{mount, name, type,
|
|
18
|
+
totalBytes, usableBytes, freeBytes, usedPct, puakmaRoot}]). With
|
|
15
19
|
--keep-alive it never ends, so it prints one envelope per poll, one per
|
|
16
20
|
line, flushed; a failure ends it with an {"ok": false} line.
|
|
17
21
|
|
|
@@ -59,6 +63,8 @@ _SPARK = "▁▂▃▄▅▆▇█"
|
|
|
59
63
|
# The points the sparkline shows (the newest)
|
|
60
64
|
_SPARK_POINTS = 20
|
|
61
65
|
_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
|
|
66
|
+
# The gateway version that added disks to GET stats
|
|
67
|
+
_DISKS_GATEWAY = "0.3.0"
|
|
62
68
|
|
|
63
69
|
|
|
64
70
|
def _command_error(e: WebDesignError | WebDesignUnavailable) -> CommandError:
|
|
@@ -91,7 +97,7 @@ def stats(
|
|
|
91
97
|
return fail(_command_error(e))
|
|
92
98
|
if keep_alive:
|
|
93
99
|
return _poll(client, reply, addin, key, delay, json_output, fail)
|
|
94
|
-
_show(s.name, reply, key, json_output)
|
|
100
|
+
_show(s.name, reply, addin, key, json_output)
|
|
95
101
|
return 0
|
|
96
102
|
|
|
97
103
|
|
|
@@ -124,7 +130,7 @@ def _poll(
|
|
|
124
130
|
elif not first and not json_output:
|
|
125
131
|
print()
|
|
126
132
|
first = False
|
|
127
|
-
_show(name, reply, key, json_output)
|
|
133
|
+
_show(name, reply, addin, key, json_output)
|
|
128
134
|
sys.stdout.flush()
|
|
129
135
|
# the spinner only runs while waiting, never over the table
|
|
130
136
|
with waiting:
|
|
@@ -138,29 +144,70 @@ def _poll(
|
|
|
138
144
|
|
|
139
145
|
|
|
140
146
|
def _show(
|
|
141
|
-
server_name: str,
|
|
147
|
+
server_name: str,
|
|
148
|
+
reply: dict[str, Any],
|
|
149
|
+
addin: str | None,
|
|
150
|
+
key: str | None,
|
|
151
|
+
json_output: bool,
|
|
142
152
|
) -> None:
|
|
153
|
+
disks = reply.get("disks")
|
|
143
154
|
if json_output:
|
|
144
|
-
|
|
155
|
+
extra: dict[str, Any] = {"time": reply["time"]}
|
|
156
|
+
if disks is not None:
|
|
157
|
+
extra["disks"] = disks
|
|
158
|
+
emit_json(envelope(server_name, reply["addins"], extra=extra))
|
|
145
159
|
return
|
|
146
160
|
addins = reply["addins"]
|
|
147
161
|
names = ", ".join(a["name"] for a in addins)
|
|
148
162
|
print(f"{server_name} at {reply['time'] or '?'} - addins: {names or 'none'}")
|
|
149
163
|
now = _date(reply["time"])
|
|
150
164
|
rows = [_row(stat, now) for a in addins for stat in a["statistics"]]
|
|
151
|
-
if
|
|
165
|
+
if rows:
|
|
166
|
+
print(
|
|
167
|
+
tabulate.tabulate(
|
|
168
|
+
rows,
|
|
169
|
+
headers=("Statistic", "Now", "Min", "Avg", "Max", "Span", "Trend"),
|
|
170
|
+
colalign=("left", "right", "right", "right", "right", "right", "left"),
|
|
171
|
+
disable_numparse=True,
|
|
172
|
+
)
|
|
173
|
+
)
|
|
174
|
+
else:
|
|
152
175
|
sys.stdout.flush()
|
|
153
176
|
logger.info(
|
|
154
177
|
f"No statistic '{key}' - 'vortex stats' lists them"
|
|
155
178
|
if key
|
|
156
179
|
else "The loaded addins keep no statistics"
|
|
157
180
|
)
|
|
158
|
-
|
|
181
|
+
if disks:
|
|
182
|
+
print()
|
|
183
|
+
_show_disks(disks)
|
|
184
|
+
elif disks is None and not addin and not key:
|
|
185
|
+
# the gateway leaves disks out of a narrowed request; a whole one
|
|
186
|
+
# without them came from a gateway that predates them
|
|
187
|
+
sys.stdout.flush()
|
|
188
|
+
logger.info(
|
|
189
|
+
f"No disk space: it needs vortex/gateway {_DISKS_GATEWAY} - update it"
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def _show_disks(disks: list[dict[str, Any]]) -> None:
|
|
194
|
+
"""One row per filesystem, df -h style; the Puakma root's marked."""
|
|
195
|
+
rows = [
|
|
196
|
+
(
|
|
197
|
+
d["mount"] + (" (Puakma root)" if d["puakmaRoot"] else ""),
|
|
198
|
+
_bytes(d["totalBytes"]),
|
|
199
|
+
_bytes(max(0, d["totalBytes"] - d["freeBytes"])),
|
|
200
|
+
_bytes(d["usableBytes"]),
|
|
201
|
+
f"{d['usedPct']:.0f}%",
|
|
202
|
+
d["type"],
|
|
203
|
+
)
|
|
204
|
+
for d in disks
|
|
205
|
+
]
|
|
159
206
|
print(
|
|
160
207
|
tabulate.tabulate(
|
|
161
208
|
rows,
|
|
162
|
-
headers=("
|
|
163
|
-
colalign=("left", "right", "right", "right", "right", "
|
|
209
|
+
headers=("Disk", "Size", "Used", "Avail", "Use%", "Type"),
|
|
210
|
+
colalign=("left", "right", "right", "right", "right", "left"),
|
|
164
211
|
disable_numparse=True,
|
|
165
212
|
)
|
|
166
213
|
)
|
|
@@ -224,6 +271,19 @@ def _number(value: float) -> str:
|
|
|
224
271
|
return text + suffix
|
|
225
272
|
|
|
226
273
|
|
|
274
|
+
def _bytes(size: int) -> str:
|
|
275
|
+
"""Binary units as df -h prints them: 512B, 4.2G, 98G, 1.8T."""
|
|
276
|
+
if size < 1024:
|
|
277
|
+
return f"{size}B"
|
|
278
|
+
value = float(size)
|
|
279
|
+
for unit in ("K", "M", "G", "T"):
|
|
280
|
+
value /= 1024
|
|
281
|
+
# decided on the rounded figure: 1023.6M reads 1.0G, not 1024M
|
|
282
|
+
if round(value) < 1024 or unit == "T":
|
|
283
|
+
break
|
|
284
|
+
return f"{value:.1f}{unit}" if round(value, 1) < 10 else f"{value:.0f}{unit}"
|
|
285
|
+
|
|
286
|
+
|
|
227
287
|
def _span(entries: list[dict[str, Any]]) -> str:
|
|
228
288
|
"""How far back the series goes: the first entry's start to the last one's end."""
|
|
229
289
|
start, end = _date(entries[0]["from"]), _date(entries[-1]["to"])
|
|
@@ -791,6 +791,20 @@ class WhoAmI(NamedTuple):
|
|
|
791
791
|
routes: list[dict[str, Any]] = [] # noqa: RUF012
|
|
792
792
|
|
|
793
793
|
|
|
794
|
+
def _disk(disk: dict[str, Any]) -> dict[str, Any]:
|
|
795
|
+
"""One filesystem of a GET stats reply's disks, every key present."""
|
|
796
|
+
return {
|
|
797
|
+
"mount": str(disk["mount"]),
|
|
798
|
+
"name": str(disk.get("name") or ""),
|
|
799
|
+
"type": str(disk.get("type") or ""),
|
|
800
|
+
"totalBytes": int(disk["totalBytes"]),
|
|
801
|
+
"usableBytes": int(disk["usableBytes"]),
|
|
802
|
+
"freeBytes": int(disk["freeBytes"]),
|
|
803
|
+
"usedPct": float(disk["usedPct"]),
|
|
804
|
+
"puakmaRoot": bool(disk.get("puakmaRoot", False)),
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
|
|
794
808
|
def _statistic(stat: dict[str, Any]) -> dict[str, Any]:
|
|
795
809
|
"""One statistic of a GET stats reply, every key present."""
|
|
796
810
|
|
|
@@ -1059,6 +1073,11 @@ class GatewayClient(WebDesignClient):
|
|
|
1059
1073
|
addin (a short name like HTTP, or the class name) narrows it to one
|
|
1060
1074
|
addin - an unknown one is NOT_FOUND; key to one statistic. A
|
|
1061
1075
|
"once" statistic's single entry has no from/to (None here).
|
|
1076
|
+
|
|
1077
|
+
disks: the server's mounted filesystems now - [{mount, name, type,
|
|
1078
|
+
totalBytes, usableBytes, freeBytes, usedPct, puakmaRoot}] - which
|
|
1079
|
+
gateway 0.3.0 adds when neither addin nor key is given; None when
|
|
1080
|
+
the reply has none (an older gateway, or a narrowed request).
|
|
1062
1081
|
"""
|
|
1063
1082
|
self._require_gateway("'vortex stats'")
|
|
1064
1083
|
params: dict[str, Any] = {}
|
|
@@ -1078,6 +1097,11 @@ class GatewayClient(WebDesignClient):
|
|
|
1078
1097
|
}
|
|
1079
1098
|
for a in reply["addins"]
|
|
1080
1099
|
],
|
|
1100
|
+
"disks": (
|
|
1101
|
+
None
|
|
1102
|
+
if reply.get("disks") is None
|
|
1103
|
+
else [_disk(d) for d in reply["disks"]]
|
|
1104
|
+
),
|
|
1081
1105
|
}
|
|
1082
1106
|
except (KeyError, TypeError, ValueError, AttributeError) as e:
|
|
1083
1107
|
raise WebDesignUnavailable(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vortex_cli
|
|
3
|
-
Version: 8.
|
|
3
|
+
Version: 8.4.0
|
|
4
4
|
Summary: Vortex CLI
|
|
5
5
|
Author-email: Jordan Amos <jordan.amos@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -106,6 +106,14 @@ While it is possible to use without it, this software has been purposefully desi
|
|
|
106
106
|
java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
## Upgrading to 8.4
|
|
110
|
+
|
|
111
|
+
- **`vortex stats` shows the server's disk space** after the statistics: each mounted local
|
|
112
|
+
filesystem's size, used and available space and Use%, as `df -h` shows them, with the
|
|
113
|
+
Puakma root's disk marked (see [Server statistics](#server-statistics)); `--json` adds them
|
|
114
|
+
as `disks`. It needs vortex/gateway 0.3.0, which adds them to `GET stats`; with an older
|
|
115
|
+
gateway the overview says so in one line.
|
|
116
|
+
|
|
109
117
|
## Upgrading to 8.3
|
|
110
118
|
|
|
111
119
|
- **`vortex weblog`** reads the server's HTTP access log (`HTTPTextLog`) through the gateway:
|
|
@@ -579,7 +587,8 @@ vortex weblog -k -n 0 only lines written from now on
|
|
|
579
587
|
|
|
580
588
|
`vortex stats` is a health check from the terminal: the time series each loaded addin keeps
|
|
581
589
|
in memory (the admin app's performance chart), through the gateway's `GET stats`
|
|
582
|
-
(`GatewaySystem`). One request per run, one row per statistic
|
|
590
|
+
(`GatewaySystem`), then the server's disk space. One request per run, one row per statistic
|
|
591
|
+
and per disk:
|
|
583
592
|
|
|
584
593
|
```
|
|
585
594
|
$ vortex stats -s dev
|
|
@@ -593,6 +602,10 @@ http.bytesouttotal 83.1M
|
|
|
593
602
|
http.hitsperminute 27 13 22.2 176 61m ▁▁▂▁▆▃▁▁▁▁▁▂▁▁█▁▁▅▅▅
|
|
594
603
|
...
|
|
595
604
|
|
|
605
|
+
Disk Size Used Avail Use% Type
|
|
606
|
+
--------------------- ------ ------ ------- ------ ------
|
|
607
|
+
/puakma (Puakma root) 24G 17G 7.3G 70% ext4
|
|
608
|
+
|
|
596
609
|
vortex stats --addin HTTP one addin (a short name, or its class name)
|
|
597
610
|
vortex stats --key stats.cpuusageperminute
|
|
598
611
|
vortex stats -k poll every 5 seconds and reprint (^C stops)
|
|
@@ -606,13 +619,21 @@ vortex stats -k poll every 5 seconds and reprint (^C stops)
|
|
|
606
619
|
- **In memory only.** The server keeps a limited window (about the last hour of a
|
|
607
620
|
per-minute statistic) and starts again on a restart, so a short `Span` means a recent
|
|
608
621
|
restart.
|
|
622
|
+
- **Disks** (gateway 0.3.0). Every mounted local filesystem the server's JVM sees, read when
|
|
623
|
+
the request is answered, as `df -h` shows them: `Used` is size minus free, `Avail` what a
|
|
624
|
+
non-root user can still write, `Use%` used / (used + avail). The disk holding the Puakma
|
|
625
|
+
root is marked. One disk seen through several mounts (a container's overlay root over its
|
|
626
|
+
host disk) is listed once; memory, kernel, read-only and network filesystems are left out.
|
|
627
|
+
No history - the gateway keeps none. `--addin` and `--key` narrow the request to statistics,
|
|
628
|
+
so they show no disks; an older gateway sends none, which the overview says once.
|
|
609
629
|
- **`-k`** re-polls every `-d` seconds (default 5) and reprints, clearing the screen when the
|
|
610
630
|
output is a terminal.
|
|
611
631
|
- **`--json`**: `data` is the addins as the gateway sends them, every key present -
|
|
612
632
|
`[{name, class, statistics: [{key, captureType, created, lastUpdated, entries: [{from, to,
|
|
613
633
|
value}]}]}]` (`captureType`: `once`, `per-second`, `per-minute`, `per-hour`, `per-day`; a
|
|
614
|
-
`once` entry has no `from`/`to`) - and `time` (the server's clock) beside it
|
|
615
|
-
|
|
634
|
+
`once` entry has no `from`/`to`) - and `time` (the server's clock) beside it, and `disks`
|
|
635
|
+
when the gateway sent them (`[{mount, name, type, totalBytes, usableBytes, freeBytes,
|
|
636
|
+
usedPct, puakmaRoot}]`). With `-k`, one envelope per poll, one per line.
|
|
616
637
|
- **Refusals.** `NOT_FOUND`: no addin of that name is loaded (`vortex stats` lists them).
|
|
617
638
|
`NOT_EXPOSED`: the gateway predates `GET stats` - update `vortex/gateway`. A blank
|
|
618
639
|
`gateway_path` is refused before anything is sent.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|