@johngaynor/ocnus 2.0.1-next.71 → 2.0.1-next.73
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.
- package/README.md +14 -7
- package/cli/lib/host.sh +175 -60
- package/cli/ocnus +19 -13
- package/herdr/README.md +65 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1275,7 +1275,7 @@ read afterwards. It is off until you turn it on, and works on macOS only.
|
|
|
1275
1275
|
|
|
1276
1276
|
```sh
|
|
1277
1277
|
ocnus host on # turn recording on
|
|
1278
|
-
ocnus host report [<period>] #
|
|
1278
|
+
ocnus host report [<period>] # the host's numbers summed up, what used the most, and where the steps' time went
|
|
1279
1279
|
ocnus host report --card <space> <card> --json # what the host recorded while each of a card's steps ran, as JSON for programs
|
|
1280
1280
|
ocnus host off # turn it off, and delete every reading
|
|
1281
1281
|
ocnus host # whether recording is on, and what it has
|
|
@@ -1342,12 +1342,19 @@ waits on the model are kept for 90 days, in `~/.config/ocnus/host`, and
|
|
|
1342
1342
|
recording uses well under 1% of the CPU.
|
|
1343
1343
|
|
|
1344
1344
|
`host report` takes the last 7 days, `<n>d` or `<n>h` back from now, a day
|
|
1345
|
-
such as `2026-11-29`, or `2026-11-01..2026-11-29`.
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1345
|
+
such as `2026-11-29`, or `2026-11-01..2026-11-29`. It says how much of the
|
|
1346
|
+
period was recorded, in all and on each day. Time with no reading, such as
|
|
1347
|
+
when no agent was open, is shown as missing, never as idle. Then it sums up
|
|
1348
|
+
each number the readings hold of the host, under CPU, memory, disk, network,
|
|
1349
|
+
and power and heat, and judges none of them: a total for an amount, such as
|
|
1350
|
+
the bytes read from the disk; an average and the most in one reading for a
|
|
1351
|
+
level, such as how busy the CPU was, or the least for the disk's free space
|
|
1352
|
+
and the Wi-Fi's signal; and how long each state lasted, such as each level
|
|
1353
|
+
of memory pressure. An average weighs each reading by its seconds in the
|
|
1354
|
+
period. One of the levels is how much of the CPU recording used, its
|
|
1355
|
+
average with watching the test runs included. A number that no reading in
|
|
1356
|
+
the period holds, as on a Mac without it or in readings from before it was
|
|
1357
|
+
recorded, is shown as not read, never as 0. Then it lists the
|
|
1351
1358
|
10 steps and the 10 phases that used the most CPU time in the period, and
|
|
1352
1359
|
the 10 of each that held the most memory at once, each one card's own, such
|
|
1353
1360
|
as LAB-150's build step, with how long it ran. Then come the 10 test runs
|
package/cli/lib/host.sh
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
# under a terminal labelled with a space, apart from everything else on the
|
|
20
20
|
# host, which is one number each, and the recorder's own CPU apart from both.
|
|
21
21
|
# A process outside those terminals is never written down, not even its pid.
|
|
22
|
+
# `host report` sums those numbers up for a period, as totals, averages and
|
|
23
|
+
# peaks, and how long each state lasted, and judges none of them.
|
|
22
24
|
#
|
|
23
25
|
# With each reading go the shares of those terminals, one each: the CPU and
|
|
24
26
|
# memory of every process under it, the commands its agent started included,
|
|
@@ -1209,13 +1211,14 @@ host_day() {
|
|
|
1209
1211
|
[ "$ok" = 1 ] && [ -n "$DAY_START" ] && [ -n "$DAY_END" ]
|
|
1210
1212
|
}
|
|
1211
1213
|
|
|
1212
|
-
# How the
|
|
1213
|
-
# was recorded,
|
|
1214
|
-
#
|
|
1215
|
-
#
|
|
1216
|
-
# the steps' time went
|
|
1214
|
+
# How the host worked over a period, in its numbers alone: how much of the
|
|
1215
|
+
# period was recorded, in all and on each day, with time with no reading
|
|
1216
|
+
# shown as missing, never as idle (host_report_sql). Then the host's numbers
|
|
1217
|
+
# summed up (host_numbers_sql), the steps, phases and test runs that used the
|
|
1218
|
+
# most (host_ranks_sql), and it ends with where the steps' time went
|
|
1219
|
+
# (host_split_sql).
|
|
1217
1220
|
host_report() {
|
|
1218
|
-
local period=${1:-7d} now start end n first last row works splits
|
|
1221
|
+
local period=${1:-7d} now start end n first last row have ranks=0 works=0 splits=0
|
|
1219
1222
|
# A card's readings, as JSON, are a form of their own.
|
|
1220
1223
|
for n in "$@"; do
|
|
1221
1224
|
case $n in --card | --json) host_card "$@"; return ;; esac
|
|
@@ -1259,21 +1262,19 @@ host_report() {
|
|
|
1259
1262
|
say "Recording is on, and takes a reading every $HOST_EVERY seconds while an ocnus agent is open."
|
|
1260
1263
|
return 0
|
|
1261
1264
|
fi
|
|
1262
|
-
# A store the recorder has not opened since
|
|
1263
|
-
#
|
|
1264
|
-
#
|
|
1265
|
-
#
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
works
|
|
1271
|
-
case $
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
die "could not read $HOST_DB"
|
|
1276
|
-
if [ "$row" = 1 ]; then
|
|
1265
|
+
# A store the recorder has not opened since a table or a column came has
|
|
1266
|
+
# none of it, and the report only reads the store, so it never adds them.
|
|
1267
|
+
# A number whose column the store lacks is not read. The lists of what
|
|
1268
|
+
# used the most need the readings' cores, the shares and the test runs,
|
|
1269
|
+
# and where the steps' time went needs the shares, and the splits to split
|
|
1270
|
+
# it.
|
|
1271
|
+
have=$(host_columns) || have=' '
|
|
1272
|
+
case $have in *' shares.'*) works=1 ;; esac
|
|
1273
|
+
case $have in *' splits.'*) splits=$works ;; esac
|
|
1274
|
+
case $have in *' readings.cores '*) case $have in *' test_runs.'*) ranks=$works ;; esac ;; esac
|
|
1275
|
+
store "$HOST_DB" "$(host_report_sql "$start" "$end" "$period")" || die "could not read $HOST_DB"
|
|
1276
|
+
store "$HOST_DB" "$(host_numbers_sql "$start" "$end" "$have")" || die "could not read $HOST_DB"
|
|
1277
|
+
if [ "$ranks" = 1 ]; then
|
|
1277
1278
|
store "$HOST_DB" "$(host_ranks_sql "$start" "$end")" || die "could not read $HOST_DB"
|
|
1278
1279
|
else
|
|
1279
1280
|
say ''
|
|
@@ -1282,17 +1283,19 @@ host_report() {
|
|
|
1282
1283
|
store "$HOST_DB" "$(host_split_sql "$start" "$end" "$works" "$splits")" || die "could not read $HOST_DB"
|
|
1283
1284
|
}
|
|
1284
1285
|
|
|
1285
|
-
# The
|
|
1286
|
-
#
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1286
|
+
# The tables and the columns the readings' store has, each column as its
|
|
1287
|
+
# table and its name, like readings.cores, between spaces, from one query.
|
|
1288
|
+
host_columns() {
|
|
1289
|
+
store "$HOST_DB" "select ' ' || coalesce(group_concat(m.name || '.' || p.name, ' '), '') || ' '
|
|
1290
|
+
from sqlite_master m join pragma_table_info(m.name) p where m.type = 'table';"
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
# The top of the report, for the period from $1 to $2, named $3: how much of
|
|
1294
|
+
# it was recorded and how much is missing, then the same for each day. A
|
|
1295
|
+
# reading covers the secs before its at, so each one counts for the part of
|
|
1296
|
+
# that which falls in the period, and in each day.
|
|
1291
1297
|
host_report_sql() {
|
|
1292
|
-
local s=$1 e=$2 name=$3
|
|
1293
|
-
[ "${4:-0}" != 1 ] ||
|
|
1294
|
-
watch="coalesce(100.0 * (select sum(watch_secs) from test_runs where started >= $s and started < $e)
|
|
1295
|
-
/ (select nullif(max(cores), 0) from readings where at > $s and at < $e + $HOST_GAP and at - secs < $e), 0)"
|
|
1298
|
+
local s=$1 e=$2 name=$3
|
|
1296
1299
|
cat <<EOF
|
|
1297
1300
|
with recursive
|
|
1298
1301
|
days(day, ds, de) as (
|
|
@@ -1304,46 +1307,158 @@ with recursive
|
|
|
1304
1307
|
cast(strftime('%s', date(day, '+1 day'), 'utc') as integer),
|
|
1305
1308
|
min($e, cast(strftime('%s', date(day, '+2 days'), 'utc') as integer))
|
|
1306
1309
|
from days where de < $e),
|
|
1307
|
-
parts(day, len, d
|
|
1308
|
-
select days.day, days.de - days.ds,
|
|
1309
|
-
max(0, min(at, days.de) - max(at - secs, days.ds)), cpu_busy, mem_pressure, disk_free_pct, cpu_self
|
|
1310
|
+
parts(day, len, d) as (
|
|
1311
|
+
select days.day, days.de - days.ds, max(0, min(at, days.de) - max(at - secs, days.ds))
|
|
1310
1312
|
from days left join readings on at > days.ds and at < days.de + $HOST_GAP and at - secs < days.de),
|
|
1311
|
-
byday(day, len, rec
|
|
1312
|
-
select day, len, cast(coalesce(sum(d), 0) as integer),
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
from parts group by day),
|
|
1318
|
-
total(len, rec, cpu, mem, disk, self) as (
|
|
1319
|
-
select $e - $s, sum(rec), sum(cpu), sum(mem), sum(disk),
|
|
1320
|
-
case when sum(self_d) > 0 then (sum(self_time) + $watch) / sum(self_d) end
|
|
1321
|
-
from byday),
|
|
1322
|
-
shown(len, rec, missing, cpu, mem, disk, self) as (
|
|
1323
|
-
select len, rec, max(0, len - rec), cpu, mem, disk, self from total),
|
|
1313
|
+
byday(day, len, rec) as (
|
|
1314
|
+
select day, len, cast(coalesce(sum(d), 0) as integer) from parts group by day),
|
|
1315
|
+
total(len, rec) as (
|
|
1316
|
+
select $e - $s, sum(rec) from byday),
|
|
1317
|
+
shown(len, rec, missing) as (
|
|
1318
|
+
select len, rec, max(0, len - rec) from total),
|
|
1324
1319
|
lines(n, k, line) as (
|
|
1325
1320
|
select 1, '', 'The host from ' || strftime('%Y-%m-%d %H:%M', $s, 'unixepoch', 'localtime') || ' to '
|
|
1326
1321
|
|| strftime('%Y-%m-%d %H:%M', $e, 'unixepoch', 'localtime') || ' ($name)' from shown
|
|
1327
1322
|
union all select 2, '', ' recorded ' || $(sql_took rec) || ' of ' || $(sql_took len) from shown
|
|
1328
1323
|
union all select 3, '', ' missing ' || $(sql_took missing) || ', shown as missing, not idle: no reading was taken then' from shown
|
|
1329
|
-
union all select 4, '', '
|
|
1330
|
-
|
|
1331
|
-
union all select 5, '', ' memory at its limit ' || $(sql_took mem) || ', ' || printf('%.1f%%', 100.0 * mem / rec)
|
|
1332
|
-
|| ' of the recorded time (memory pressure at warning or critical)' from shown
|
|
1333
|
-
union all select 6, '', ' disk at its limit ' || $(sql_took disk) || ', ' || printf('%.1f%%', 100.0 * disk / rec)
|
|
1334
|
-
|| ' of the recorded time (under 10% free on the disk holding the home folder)' from shown
|
|
1335
|
-
union all select 7, '', ' recording ' || case when self is null then 'its own use of the CPU was not read'
|
|
1336
|
-
else 'used ' || printf('%.2f%%', self) || ' of the CPU, all cores together, on average' end from shown
|
|
1337
|
-
union all select 8, '', '' union all select 9, '', 'By day:'
|
|
1338
|
-
union all select 10, day, ' ' || day || ' recorded ' || $(sql_took rec) || ', missing ' || $(sql_took "max(0, len - rec)")
|
|
1339
|
-
|| case when rec > 0 then '; at its limit: CPU ' || printf('%.1f%%', 100.0 * cpu / rec)
|
|
1340
|
-
|| ', memory ' || printf('%.1f%%', 100.0 * mem / rec) || ', disk ' || printf('%.1f%%', 100.0 * disk / rec)
|
|
1341
|
-
else '' end
|
|
1324
|
+
union all select 4, '', '' union all select 5, '', 'By day:'
|
|
1325
|
+
union all select 6, day, ' ' || day || ' recorded ' || $(sql_took rec) || ', missing ' || $(sql_took "max(0, len - rec)")
|
|
1342
1326
|
from byday)
|
|
1343
1327
|
select line from lines order by n, k;
|
|
1344
1328
|
EOF
|
|
1345
1329
|
}
|
|
1346
1330
|
|
|
1331
|
+
# The numbers a reading holds of the host, in the order the report gives
|
|
1332
|
+
# them: CPU, memory, disk, network, and power and heat.
|
|
1333
|
+
HOST_NUMBERS='cpu_busy cpu_system cpu_agents cpu_rest cpu_self cpu_p cpu_e
|
|
1334
|
+
mem_pressure mem_used_mb mem_agents_mb mem_rest_mb compressed_mb swap_used_mb swap_ins swap_outs
|
|
1335
|
+
disk_read_kb disk_write_kb disk_free_pct
|
|
1336
|
+
net_in_kb net_out_kb net_wifi net_resent_pct wifi_rssi wifi_noise
|
|
1337
|
+
on_battery low_power thermal'
|
|
1338
|
+
|
|
1339
|
+
# The host's numbers from $1 to $2, under five headings: CPU, memory, disk,
|
|
1340
|
+
# network, and power and heat. They are read from r, the readings in the
|
|
1341
|
+
# period, each with d, the part of its secs in the period, as the report
|
|
1342
|
+
# counts a reading. Each number is summed up as what it is:
|
|
1343
|
+
# a level its average, each reading weighed by its d, over the readings
|
|
1344
|
+
# that hold it, and its highest in one reading, or its lowest
|
|
1345
|
+
# for the disk's free space and the Wi-Fi's signal (host_level)
|
|
1346
|
+
# an amount its total: the recorder writes what it grew by in each
|
|
1347
|
+
# reading, and one on the period's edge counts in proportion to
|
|
1348
|
+
# its d, as host_split_sql counts a split (host_amount)
|
|
1349
|
+
# a state how long each value lasted, and how long it was not read when
|
|
1350
|
+
# that is more than nothing (host_state)
|
|
1351
|
+
# A number no reading in the period holds says not read in place of its
|
|
1352
|
+
# figures, as SQLite's printf would print a null as 0, and sql_took of a
|
|
1353
|
+
# null is null. $3 lists the store's tables and columns, as host_columns
|
|
1354
|
+
# gives them, and a column the store lacks is read as null, so that its
|
|
1355
|
+
# number says not read too. Every line is worked out in one pass over the
|
|
1356
|
+
# readings, into one array, which gives them in its order.
|
|
1357
|
+
#
|
|
1358
|
+
# Recording's average adds what watching the test runs that started in the
|
|
1359
|
+
# period used, as a share of the cores the readings counted, over the time
|
|
1360
|
+
# its own CPU was read. No reading holds that, so its most in one reading
|
|
1361
|
+
# is the recorder's own.
|
|
1362
|
+
host_numbers_sql() {
|
|
1363
|
+
local s=$1 e=$2 have=$3 c cols='' watch=''
|
|
1364
|
+
for c in $HOST_NUMBERS; do
|
|
1365
|
+
case $have in *" readings.$c "*) cols="$cols, $c" ;; *) cols="$cols, null as $c" ;; esac
|
|
1366
|
+
done
|
|
1367
|
+
case $have in
|
|
1368
|
+
*' readings.cores '*)
|
|
1369
|
+
case $have in
|
|
1370
|
+
*' test_runs.watch_secs '*)
|
|
1371
|
+
watch="coalesce(100.0 * (select sum(watch_secs) from test_runs where started >= $s and started < $e)
|
|
1372
|
+
/ (select nullif(max(cores), 0) from readings where at > $s and at < $e + $HOST_GAP and at - secs < $e), 0)"
|
|
1373
|
+
;;
|
|
1374
|
+
esac
|
|
1375
|
+
;;
|
|
1376
|
+
esac
|
|
1377
|
+
cat <<EOF
|
|
1378
|
+
with
|
|
1379
|
+
r as (
|
|
1380
|
+
select max(0, min(at, $e) - max(at - secs, $s)) as d, secs$cols from readings
|
|
1381
|
+
where at > $s and at < $e + $HOST_GAP and at - secs < $e and secs > 0),
|
|
1382
|
+
numbers(lines) as (
|
|
1383
|
+
select json_array(
|
|
1384
|
+
'', 'CPU, as a share of all cores'' time:',
|
|
1385
|
+
$(host_level busy cpu_busy '%.1f%%'),
|
|
1386
|
+
$(host_level system cpu_system '%.1f%%'),
|
|
1387
|
+
$(host_level 'the agents' cpu_agents '%.1f%%'),
|
|
1388
|
+
$(host_level 'the rest' cpu_rest '%.1f%%'),
|
|
1389
|
+
$(host_level recording cpu_self '%.2f%%' '' most "$watch"),
|
|
1390
|
+
$(host_level 'performance cores' cpu_p '%.1f%%' 'busy on average'),
|
|
1391
|
+
$(host_level 'efficiency cores' cpu_e '%.1f%%' 'busy on average'),
|
|
1392
|
+
'', 'Memory:',
|
|
1393
|
+
$(host_state pressure mem_pressure 'not read' normal '< 2' warning 'between 2 and 3' critical '>= 4'),
|
|
1394
|
+
$(host_level used mem_used_mb '%.0f MB'),
|
|
1395
|
+
$(host_level 'the agents' mem_agents_mb '%.0f MB'),
|
|
1396
|
+
$(host_level 'the rest' mem_rest_mb '%.0f MB'),
|
|
1397
|
+
$(host_level compressed compressed_mb '%.0f MB'),
|
|
1398
|
+
$(host_level 'swap used' swap_used_mb '%.0f MB'),
|
|
1399
|
+
$(host_amount 'swapped in' swap_ins '%.0f pages'),
|
|
1400
|
+
$(host_amount 'swapped out' swap_outs '%.0f pages'),
|
|
1401
|
+
'', 'Disk:',
|
|
1402
|
+
$(host_amount read disk_read_kb '%.1f MB' 1024),
|
|
1403
|
+
$(host_amount written disk_write_kb '%.1f MB' 1024),
|
|
1404
|
+
$(host_level free disk_free_pct '%.1f%%' '' lowest),
|
|
1405
|
+
'', 'Network:',
|
|
1406
|
+
$(host_amount received net_in_kb '%.1f MB' 1024),
|
|
1407
|
+
$(host_amount sent net_out_kb '%.1f MB' 1024),
|
|
1408
|
+
$(host_state interface net_wifi 'offline or not read' Wi-Fi '= 1' another '= 0'),
|
|
1409
|
+
$(host_level 'sent again' net_resent_pct '%.1f%%' 'of TCP bytes on average'),
|
|
1410
|
+
$(host_level 'Wi-Fi signal' wifi_rssi '%.0f dBm' '' lowest),
|
|
1411
|
+
$(host_level 'Wi-Fi noise' wifi_noise '%.0f dBm'),
|
|
1412
|
+
'', 'Power and heat:',
|
|
1413
|
+
$(host_state power on_battery 'not read' 'on battery' '= 1' 'on power' '= 0'),
|
|
1414
|
+
$(host_state 'Low Power Mode' low_power 'not read' on '= 1' off '= 0'),
|
|
1415
|
+
$(host_state 'thermal state' thermal 'not read' nominal '= 0' fair '= 1' serious '= 2' critical '= 3'))
|
|
1416
|
+
from r)
|
|
1417
|
+
select value from numbers, json_each(numbers.lines) order by key;
|
|
1418
|
+
EOF
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
# SQL for a line of the host's numbers on a level, over the readings r: the
|
|
1422
|
+
# label $1, then the average of the column $2, with the words $4 after it,
|
|
1423
|
+
# or "on average", and its highest in one reading, or its lowest with $5 as
|
|
1424
|
+
# lowest. $3 is the printf format of each figure. $6, when given, is added
|
|
1425
|
+
# to the readings' sum before it is divided by their seconds.
|
|
1426
|
+
host_level() {
|
|
1427
|
+
local peak="max($2)" most='at most'
|
|
1428
|
+
[ "${5:-}" != lowest ] || peak="min($2)" most='at the lowest'
|
|
1429
|
+
printf '%s' "' ' || printf('%-19s', '$1') || case when count($2) = 0 then 'not read'
|
|
1430
|
+
else printf('$3', (sum(1.0 * $2 * d)${6:+ + $6}) / sum(case when $2 is not null then d end))
|
|
1431
|
+
|| ' ${4:-on average}, ' || printf('$3', $peak) || ' $most' end"
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
# SQL for a line of the host's numbers on an amount, over the readings r:
|
|
1435
|
+
# the label $1, then the total of the column $2, divided by $4 when it is
|
|
1436
|
+
# given, in the printf format $3. Each reading counts what it grew by for
|
|
1437
|
+
# its d in proportion to its secs.
|
|
1438
|
+
host_amount() {
|
|
1439
|
+
printf '%s' "' ' || printf('%-19s', '$1') || case when count($2) = 0 then 'not read'
|
|
1440
|
+
else printf('$3', sum(1.0 * $2 * d / secs)${4:+ / $4}) end"
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
# SQL for a line of the host's numbers on a state, over the readings r: the
|
|
1444
|
+
# label $1, then how long the column $2 held each value, $4 onward, each a
|
|
1445
|
+
# name and the SQL that tests the column for it, like normal '< 2'. Then,
|
|
1446
|
+
# when it is more than nothing, how long it held none of them, which $3
|
|
1447
|
+
# names.
|
|
1448
|
+
host_state() {
|
|
1449
|
+
local label=$1 col=$2 none=$3 shown='' left='sum(d)' v
|
|
1450
|
+
shift 3
|
|
1451
|
+
while [ "$#" -ge 2 ]; do
|
|
1452
|
+
v="sum(case when $col $2 then d else 0 end)"
|
|
1453
|
+
[ -z "$shown" ] || shown="$shown || ', ' || "
|
|
1454
|
+
shown="$shown'$1 ' || $(sql_took "$v")"
|
|
1455
|
+
left="$left - $v"
|
|
1456
|
+
shift 2
|
|
1457
|
+
done
|
|
1458
|
+
printf '%s' "' ' || printf('%-19s', '$label') || case when count($col) = 0 then 'not read'
|
|
1459
|
+
else $shown || case when $left > 0 then ', $none ' || $(sql_took "($left)") else '' end end"
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1347
1462
|
# The steps and the phases that used the most CPU time, and that held the
|
|
1348
1463
|
# most memory at once, from $1 to $2: ten of each, each one card's own. Each
|
|
1349
1464
|
# counts what its shares say for the part of their reading in the period,
|
package/cli/ocnus
CHANGED
|
@@ -121,11 +121,11 @@ Usage:
|
|
|
121
121
|
ocnus host say whether how hard this machine works is recorded
|
|
122
122
|
ocnus host on record it every 10 seconds while an agent is open
|
|
123
123
|
ocnus host off stop recording, and delete every reading
|
|
124
|
-
ocnus host report [<period>]
|
|
125
|
-
steps, phases and test runs that used the
|
|
126
|
-
memory, and where the steps' time went: <n>d
|
|
127
|
-
from now (7d when none is given), a day
|
|
128
|
-
<day>..<day>
|
|
124
|
+
ocnus host report [<period>] the host's CPU, memory, disk, network, and power and heat,
|
|
125
|
+
summed up, the steps, phases and test runs that used the
|
|
126
|
+
most CPU and memory, and where the steps' time went: <n>d
|
|
127
|
+
or <n>h back from now (7d when none is given), a day
|
|
128
|
+
YYYY-MM-DD, or <day>..<day>
|
|
129
129
|
ocnus host report --card <space> <card> --json
|
|
130
130
|
what the host recorded while each of a card's steps ran, as
|
|
131
131
|
one line of JSON for programs: each step's start and end,
|
|
@@ -381,14 +381,20 @@ run's command is kept only as a fingerprint, a number the same for the same
|
|
|
381
381
|
command, from which its text cannot be read back. It needs no admin rights,
|
|
382
382
|
and is never sent off the machine. Readings are kept for 90 days, in
|
|
383
383
|
~/.config/ocnus/host/readings.db. `host report` says, for a period, how
|
|
384
|
-
much of it was recorded
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
384
|
+
much of it was recorded, in all and on each day. Time with no reading, such
|
|
385
|
+
as when no agent was open, is shown as missing, never as idle. Then it sums
|
|
386
|
+
up each number the readings hold of the host, and judges none of them: a
|
|
387
|
+
total for an amount, such as the bytes read from the disk; an average and
|
|
388
|
+
the most in one reading for a level, such as how busy the CPU was, or the
|
|
389
|
+
least for the disk's free space and the Wi-Fi's signal; and how long each
|
|
390
|
+
state lasted, such as each level of memory pressure. An average weighs each
|
|
391
|
+
reading by its seconds in the period. One of the levels is how much of the
|
|
392
|
+
CPU recording used, its average with watching the test runs included. A
|
|
393
|
+
number that no reading in the period holds, as on a Mac without it or in
|
|
394
|
+
readings from before it was recorded, is shown as not read, never as 0.
|
|
395
|
+
Then it lists the 10 steps and the 10 phases, each one card's own, that
|
|
396
|
+
used the most CPU time, and that held the most memory at once, then the 10
|
|
397
|
+
test runs that did.
|
|
392
398
|
|
|
393
399
|
While the host is recorded, `task new` and `task build` also start claude
|
|
394
400
|
with hooks that mark when its agent starts and stops, is given a prompt,
|
package/herdr/README.md
CHANGED
|
@@ -2224,7 +2224,7 @@ turn it on, and works on macOS only.
|
|
|
2224
2224
|
ocnus host # whether recording is on, and what it has
|
|
2225
2225
|
ocnus host on # turn recording on
|
|
2226
2226
|
ocnus host off # turn it off, and delete every reading
|
|
2227
|
-
ocnus host report [<period>] #
|
|
2227
|
+
ocnus host report [<period>] # the host's numbers summed up, what used the most, and where the steps' time went
|
|
2228
2228
|
ocnus host report --card <space> <card> --json # what the host recorded while each of a card's steps ran, as JSON for programs
|
|
2229
2229
|
ocnus tests run <command> # run a test command, and record the test run
|
|
2230
2230
|
```
|
|
@@ -2557,17 +2557,37 @@ ocnus tests run <command> # run a test command, and record the test run
|
|
|
2557
2557
|
|
|
2558
2558
|
Anything else, such as a day that does not exist like `2026-02-30`, is
|
|
2559
2559
|
refused. It says how much of the period was recorded and how much was
|
|
2560
|
-
missing, then
|
|
2561
|
-
recorded time it was at its limit. A line for each day follows, with the same
|
|
2562
|
-
figures.
|
|
2560
|
+
missing, then the same for each day.
|
|
2563
2561
|
|
|
2564
|
-
- **At its limit** means the CPU was at least 90% busy across all cores,
|
|
2565
|
-
memory pressure was at warning or critical, or under 10% of the home
|
|
2566
|
-
folder's disk was free.
|
|
2567
2562
|
- **Time with no reading is shown as missing, never as idle.** That is the
|
|
2568
2563
|
time no agent was open, as well as when the machine slept or recording was
|
|
2569
2564
|
off. A period with no readings at all says so.
|
|
2570
2565
|
|
|
2566
|
+
Then come the host's numbers, under five headings: CPU, memory, disk,
|
|
2567
|
+
network, and power and heat. Each is what the readings in the period hold
|
|
2568
|
+
of it, summed up as what it is, and none is judged:
|
|
2569
|
+
|
|
2570
|
+
- **A level**, such as how busy the CPU was or the memory used, has its
|
|
2571
|
+
average and the most it was in one reading, or the least for the disk's
|
|
2572
|
+
free space and the Wi-Fi's signal. The average weighs each reading by its
|
|
2573
|
+
seconds in the period, over the readings that hold the number. The CPU's
|
|
2574
|
+
levels are shares of all cores' time, but for the performance and the
|
|
2575
|
+
efficiency cores, each a share of its own cores' time.
|
|
2576
|
+
- **An amount**, such as the bytes read from the disk or received, or the
|
|
2577
|
+
pages swapped in, has its total. A reading on the period's edge counts in
|
|
2578
|
+
proportion to its seconds in the period.
|
|
2579
|
+
- **A state**, such as memory pressure, the interface the traffic went by,
|
|
2580
|
+
being on battery, Low Power Mode or the thermal state, has how long each
|
|
2581
|
+
value lasted, and how long it was not read when it was not, offline
|
|
2582
|
+
included for the interface. They add up to the recorded time.
|
|
2583
|
+
- **Recording** is how much of the CPU recording used. Its average adds
|
|
2584
|
+
what watching the test runs that started in the period used, which no
|
|
2585
|
+
reading holds, so its most in one reading is the recorder's own.
|
|
2586
|
+
- **Not read** stands in place of a number's figures when no reading in the
|
|
2587
|
+
period holds it, as on a Mac whose cores have no type, a wired host, which
|
|
2588
|
+
has no Wi-Fi signal, or readings from before the network and the power and
|
|
2589
|
+
heat were recorded. It is never shown as 0.
|
|
2590
|
+
|
|
2571
2591
|
Then come the steps, the phases and the test runs that used the most:
|
|
2572
2592
|
|
|
2573
2593
|
- **The 10 steps and the 10 phases that used the most CPU time** in the
|
|
@@ -2605,13 +2625,47 @@ Then comes where the steps' time went:
|
|
|
2605
2625
|
The host from 2026-11-22 17:20 to 2026-11-29 17:20 (7d)
|
|
2606
2626
|
recorded 9h 41m of 7d 00h
|
|
2607
2627
|
missing 6d 14h, shown as missing, not idle: no reading was taken then
|
|
2608
|
-
CPU at its limit 2h 03m, 21.2% of the recorded time (at least 90% busy across all cores)
|
|
2609
|
-
memory at its limit 0s, 0.0% of the recorded time (memory pressure at warning or critical)
|
|
2610
|
-
disk at its limit 0s, 0.0% of the recorded time (under 10% free on the disk holding the home folder)
|
|
2611
|
-
recording used 0.22% of the CPU, all cores together, on average
|
|
2612
2628
|
|
|
2613
2629
|
By day:
|
|
2614
2630
|
...
|
|
2631
|
+
2026-11-29 recorded 7h 41m, missing 9h 39m
|
|
2632
|
+
|
|
2633
|
+
CPU, as a share of all cores' time:
|
|
2634
|
+
busy 31.2% on average, 98.7% at most
|
|
2635
|
+
system 6.1% on average, 22.4% at most
|
|
2636
|
+
the agents 12.4% on average, 81.0% at most
|
|
2637
|
+
the rest 18.5% on average, 64.2% at most
|
|
2638
|
+
recording 0.22% on average, 0.91% at most
|
|
2639
|
+
performance cores 44.0% busy on average, 100.0% at most
|
|
2640
|
+
efficiency cores 18.3% busy on average, 97.1% at most
|
|
2641
|
+
|
|
2642
|
+
Memory:
|
|
2643
|
+
pressure normal 9h 20m, warning 20m 10s, critical 50s
|
|
2644
|
+
used 11204 MB on average, 15872 MB at most
|
|
2645
|
+
the agents 2210 MB on average, 6034 MB at most
|
|
2646
|
+
the rest 8994 MB on average, 12001 MB at most
|
|
2647
|
+
compressed 1320 MB on average, 4096 MB at most
|
|
2648
|
+
swap used 512 MB on average, 2048 MB at most
|
|
2649
|
+
swapped in 1204 pages
|
|
2650
|
+
swapped out 88210 pages
|
|
2651
|
+
|
|
2652
|
+
Disk:
|
|
2653
|
+
read 12408.3 MB
|
|
2654
|
+
written 3120.0 MB
|
|
2655
|
+
free 41.2% on average, 38.9% at the lowest
|
|
2656
|
+
|
|
2657
|
+
Network:
|
|
2658
|
+
received 820.4 MB
|
|
2659
|
+
sent 96.1 MB
|
|
2660
|
+
interface Wi-Fi 9h 30m, another 0s, offline or not read 11m 00s
|
|
2661
|
+
sent again 0.4% of TCP bytes on average, 12.0% at most
|
|
2662
|
+
Wi-Fi signal -58 dBm on average, -71 dBm at the lowest
|
|
2663
|
+
Wi-Fi noise -92 dBm on average, -84 dBm at most
|
|
2664
|
+
|
|
2665
|
+
Power and heat:
|
|
2666
|
+
power on battery 1h 02m, on power 8h 39m
|
|
2667
|
+
Low Power Mode on 0s, off 9h 41m
|
|
2668
|
+
thermal state nominal 9h 12m, fair 25m 00s, serious 4m 00s, critical 0s
|
|
2615
2669
|
|
|
2616
2670
|
Steps that used the most CPU time:
|
|
2617
2671
|
LAB-150 build step CPU time 1h 12m, ran 2h 40m
|