krn.JobThreadGetInfo

This job returns information about the server’s threads, in particular about the job currently or last executed on the respective thread. It is the lightweight snapshot (which thread ran which job, as whom, for how long); the detailed drill-down into a single thread is provided by krn.JobThreadGetCallStack.

1. Input Parameters

Name Type Required Description

Flags

INT

Yes

Currently not supported — pass 0.

2. Output Parameters

Name Type Dependency Description

Info

STRING

Base64-encoded buffer with one record per thread. See the structure below.

InfoType

STRING

Semicolon-separated description of the fields returned per record in Info

3. Structure of the Info buffer

The buffer is base64-encoded and decodes to one record per thread. The 20 fields described by the InfoType parameter are plain ASCII text separated by NUL characters (0x00); only these 20 fields form the stable contract. After the last field an undocumented binary structure follows (internal pointers; in memory dumps additionally a copy of the active session-GUID list) that should be ignored.

The timestamp fields (created, start, performed, stop) use the format <epoch>.<sequence>, i.e. Unix epoch seconds followed by a running sequence number.

InfoType returns the following field order:

Field Description

threadid

OS thread identifier (identical to the thread identifiers from krn.QueueGetStatistic and krn.JobThreadGetCallStack)

queue

Queue the thread belongs to

number

Index of the thread within its queue (0 … NumThreads-1)

jobsummary

Runtime of the current or last executed job in seconds (right-justified)

jobcount

Number of jobs processed by this thread

connection

Identifier of the connection handling the job; -1 when the thread is idle

created

Creation or enqueue time of the job

uniquenumber

Monotonically increasing job instance identifier

jobname

Name of the current or last executed job

personality

Security/impersonation context level (inferred)

start

Start time of the job

performed

Time at which processing actually began

stop

End time of the job; equals start while the job is still running or has just finished

jobstate

Status code of the job (0 = idle/done)

jobcp

Content-processing flag (inferred)

sessguid

GUID of the work session that owns the job

statname

Name of the station (computer name)

username

User the job runs as

sql

Currently executed SQL statement; only populated while the thread runs a database query

dbstate

Status code of the database connection

Idle threads return jobname, sessguid and username empty, connection = -1 and the timestamps 0.000.

4. Return Value

(INT): 0 = Job successful, otherwise error code.