From 4c72ec7f3eb4b40f3d41d65f6310885811b0fb01 Mon Sep 17 00:00:00 2001 From: Oleg <18466855+EvaTheSalmon@users.noreply.github.com> Date: Thu, 1 Oct 2026 13:43:45 +0300 Subject: [PATCH] docs(provision): register pens only from the refresh button SemiPlot calls semiplot_register_new_pens() only from its pen editor's "Refresh pen list" button and never at start, so the cost estimate is paid per press, not per viewer start. Claude-Session: https://claude.ai/code/session_01PfZJa7neMMKPzycFR6iuhD --- docs/architecture/provisioning.md | 6 +++--- docs/deployment.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/architecture/provisioning.md b/docs/architecture/provisioning.md index 0bb6451..0340d42 100644 --- a/docs/architecture/provisioning.md +++ b/docs/architecture/provisioning.md @@ -253,8 +253,8 @@ arriving uneditable. The archive carries no variable catalogue of its own, so `trends.id` is the only reliable source of pen keys. `semiplot_register_new_pens()` (`sql/semiplot_register.sql`) inserts one `semiplot_tags` -row for every key in `trends` that has none and returns how many it added. The viewer calls it at -start and from its pen editor's refresh button. A new row is named by its number, takes a colour +row for every key in `trends` that has none and returns how many it added. The viewer calls it only +from its pen editor's "Refresh pen list" button, never at start. A new row is named by its number, takes a colour from a fixed twelve-colour palette by `id % 12`, which assumes SCADA variable numbers are non-negative (a negative `id` gets a `NULL` colour, and the viewer picks one), starts with `enabled_on_start = false`, so a SCADA @@ -309,7 +309,7 @@ per partition per step, 0.8 ms on 17 and 1.4 ms on 14 over the one-day archive. The measured archives are small, and the cost is linear in keys times partitions. A linear extrapolation from the 91-partition row, not a measurement: 500 keys over 365 day partitions is 40 times the probes, about 2.6 s for a call that adds nothing and about 4.8 s for one that adds every -key, which is past one second at every viewer start and refresh. Whether a site reaches that +key, which is past one second at every press of the refresh button. Whether a site reaches that depends on the retention depth, which is `UNDECIDED` ([README.md](./README.md)); the call stays inside the `semiplot` role's 30 s `statement_timeout` either way. diff --git a/docs/deployment.md b/docs/deployment.md index 273570b..26a1e9e 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -103,8 +103,8 @@ DDL. Права `CREATE` в схеме `public` у роли `semiplot` нет | `semiplot_pen_groups` | Принадлежность пера группам. Перо может входить в несколько групп и ни в одну | | `semiplot_meta` | Одну строку: версию схемы | -Перья появляются в `semiplot_tags` сами. SemiPlot при запуске и по кнопке обновления в редакторе -перьев вызывает функцию `semiplot_register_new_pens()`: она добавляет по строке на каждый номер +Перья появляются в `semiplot_tags` по кнопке «Обновить список перьев» в редакторе перьев SemiPlot, +при запуске SemiPlot их не добавляет. Кнопка вызывает функцию `semiplot_register_new_pens()`: она добавляет по строке на каждый номер переменной из `trends`, у которого строки ещё нет, и возвращает число добавленных. Новое перо называется своим номером, получает цвет из фиксированной палитры, по умолчанию скрыто при старте и масштабируется автоматически. Перо переменной, которую SCADA перестала писать, остаётся: её