Skip to content
Konstera
Capability catalogue
evidenceread

db.proc.stats

Get procedure statistics

Execution statistics of a stored procedure from the plan cache (sys.dm_exec_procedure_stats), summed over its cached plans. Every field is null when the procedure is not in the plan cache (not run since the last restart or cache flush): that means no statistics, not zero executions. Internal evidence: for understanding only, never quoted.

Effect
read
Fanout
no
Cache TTL
none
Traits
internal_evidence, read_only

Request arguments

Passed as the args parameter to ctx.capability.call("db.proc.stats", …).

FieldTypeRequiredDescription
namestringyesschema.name or name of a stored procedure

Response

Returned by ctx.capability.call("db.proc.stats", …).

FieldTypeRequiredDescription
cachedTimestring | nullyes
avgElapsedMsnumber | nullyes
maxElapsedMsnumber | nullyes
lastElapsedMsnumber | nullyes
executionCountinteger | nullyes
lastExecutionTimestring | nullyes

Example call

From inside your agent's handle(). The kernel resolves db.proc.stats to the tenant's connector binding at invocation time.

response = await ctx.capability.call(
    "db.proc.stats",
    args={
        "name": "...",
    },
)

See SDK quickstart for the full agent handler template; code examples covers invocation patterns including fanout and error handling.