nsmcp::CodexQuestionBackend object method processTriples (public)

 nsmcp::CodexQuestionBackend[i] processTriples capture

Defined in /usr/local/ns/tcl/nsmcp/question-backend.tcl

Serialize bounded Codex startup diagnostics.

Parameters:
capture (required)
The process and thread snapshot.
Returns:
Typed JSON members with approved diagnostic fields.

Testcases:
No testcase defined.
Source code:
set triples [::nsmcp::codexProcessFields $capture  {capturedAtMs elapsedMs processLimit threadLimit} {source status reason}]
set processes {};set index 0;set remaining 128
if {[dict exists $capture processes]} {
    foreach process [lrange [dict get $capture processes] 0 7] {
        set row [::nsmcp::codexProcessFields $process  {pid parentPid startTicks userTicks systemTicks readBytes writeBytes threadCount omittedThreads} {name state}]
        set threads {};set j 0
        if {[dict exists $process threads]} {
            foreach thread [lrange [dict get $process threads] 0 [expr {$remaining-1}]] {
                if {$remaining<=0} {break}
                incr remaining -1
                set fields [::nsmcp::codexProcessFields $thread {tid userTicks systemTicks syscall fileDescriptor} {name state waitChannel readOperation fileResolution}]
                if {[dict exists $thread filePath]} {
                    set path [dict get $thread filePath]
                    if {[string length $path]<=1024 && [string index $path 0] eq "/"
                        && ![regexp {[\x00-\x1f\x7f]} $path]} {
                        lappend fields filePath string $path
                    }
                }
                lappend threads $j object $fields
                incr j
            }
        }
        lappend row threads array $threads
        lappend processes $index object $row
        incr index
    }
}
lappend triples processes array $processes
return $triples
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: