Compare repo and store endpoints in token stats

This commit is contained in:
mpabi
2026-04-26 10:36:25 +02:00
parent 663242c855
commit 918b192212
4 changed files with 179 additions and 37 deletions
+10 -9
View File
@@ -118,22 +118,23 @@ python3 workspace.py tokens read --show-secrets
### `tokens stats`
Pokazuje statystyki per endpoint serwera.
Pokazuje statystyki per endpoint serwera i porownuje dwa zrodla:
- endpointy znalezione w remote URL-ach repo
- endpointy zapisane w `tokens.json`
Wynik ma ten sam model co `tokens read`, ale w formie zbiorczej:
- endpoint
- type
- scheme
- host
- port
- users
- tokens
- liczbe endpointow w repo
- liczbe endpointow w store
- laczna unie endpointow
- statusy zgodnosci, na przyklad `in_sync`, `store_ahead`, `repo_ahead`
- tabele endpointow z liczbami tokenow po obu stronach
Przyklad:
```bash
python3 workspace.py tokens stats
python3 workspace.py tokens stats --repo ~/dev/workspace/rv/series/inf/03
```
### `tokens write`
+19 -4
View File
@@ -283,24 +283,39 @@ python3 workspace.py tokens read --server http://77.90.8.171:3001
## `tokens stats`
Pokazuje statystyki tokenow per endpoint serwera.
Pokazuje statystyki endpointow z repo i `tokens.json`, a takze ich zgodnosc
wzgledem siebie.
Przelaczniki:
- `--repo PATH`
Sciezka wewnatrz repo, z ktorego maja byc odczytane remote URL-e.
- `--server ENDPOINT`
Ogranicza wynik do jednego endpointu.
Typowy wynik:
```text
endpoint<TAB>type<TAB>scheme<TAB>host<TAB>port<TAB>users<TAB>tokens
http://77.90.8.171:3001<TAB>gitea<TAB>http<TAB>77.90.8.171<TAB>3001<TAB>1<TAB>1
repo_root<TAB>...
token_path<TAB>...
repo_endpoints<TAB>1
store_endpoints<TAB>1
union_endpoints<TAB>1
in_sync<TAB>0
repo_only<TAB>0
store_only<TAB>0
repo_ahead<TAB>0
store_ahead<TAB>1
diverged<TAB>0
endpoint<TAB>type<TAB>repo_remotes<TAB>repo_urls<TAB>repo_auth_urls<TAB>repo_plain_urls<TAB>repo_users<TAB>repo_tokens<TAB>store_users<TAB>store_tokens<TAB>repo_only_tokens<TAB>store_only_tokens<TAB>status
http://77.90.8.171:3001<TAB>gitea<TAB>origin<TAB>1<TAB>0<TAB>1<TAB>0<TAB>0<TAB>1<TAB>1<TAB>0<TAB>1<TAB>store_ahead
```
Przyklad:
```bash
python3 workspace.py tokens stats
python3 workspace.py tokens stats --repo ~/dev/workspace/rv/series/inf/03
```
## `tokens write`