Refactor architecture into eight components and consolidate reliability work
Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts. Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation. Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
This commit is contained in:
1 parent
9dd425f765
commit
d5d21b7841
302 files changed
+20037
-3492
No files matched your search
@@ -1,52 +1,10 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
import "pageswiki/internal/seheweit"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// A new process gets a new identity, even when a container reuses PID 1.
|
||||
var resourceProcessID = uuid.NewString()
|
||||
|
||||
type processIOCounters struct {
|
||||
Scope string `json:"scope"`
|
||||
Available bool `json:"available"`
|
||||
ProcessID string `json:"process_id"`
|
||||
ReadBytes uint64 `json:"read_bytes"`
|
||||
WriteBytes uint64 `json:"write_bytes"`
|
||||
}
|
||||
|
||||
func readProcessIO() processIOCounters {
|
||||
data, _ := os.ReadFile("/proc/self/io")
|
||||
return parseProcessIO(string(data))
|
||||
}
|
||||
// Compatibility facade; the process identity and parser belong to Seheweit.
|
||||
type processIOCounters = seheweit.ProcessIO
|
||||
|
||||
func parseProcessIO(data string) processIOCounters {
|
||||
result := processIOCounters{Scope: "process", ProcessID: resourceProcessID}
|
||||
read, write := false, false
|
||||
for _, line := range strings.Split(data, "\n") {
|
||||
fields := strings.Fields(line)
|
||||
if len(fields) != 2 {
|
||||
continue
|
||||
}
|
||||
if fields[0] != "read_bytes:" && fields[0] != "write_bytes:" {
|
||||
continue
|
||||
}
|
||||
value, err := strconv.ParseUint(fields[1], 10, 64)
|
||||
if err != nil {
|
||||
return result
|
||||
}
|
||||
if fields[0] == "read_bytes:" {
|
||||
result.ReadBytes = value
|
||||
read = true
|
||||
} else {
|
||||
result.WriteBytes = value
|
||||
write = true
|
||||
}
|
||||
}
|
||||
result.Available = read && write
|
||||
return result
|
||||
return seheweit.ParseProcessIO(data)
|
||||
}
|
||||
Reference in new issue
Block a user