19 lines
1.6 KiB
Plaintext
19 lines
1.6 KiB
Plaintext
:sig
|
|
DValue request_perf()
|
|
|
|
:params
|
|
return value : performance snapshot for the active request/workspace
|
|
|
|
:see
|
|
>sys
|
|
>time_precise
|
|
|
|
:content
|
|
Returns a DValue with timing and process metadata such as worker pid, parent pid, request count, request start times, native dispatch, workspace setup and birth, context application, guest execution, and hostcall timing. Hostcall totals include component resolution; MySQL, memcache, and component resolution also expose their own count and microsecond fields. `mysql_operations` is an ordered, query-text-free list of up to 64 logical MySQL operations and their microsecond durations. A connect operation also identifies its source as `new`, cross-request `worker`, or same-request `request`; the corresponding `mysql_connection_open_count`, `mysql_connection_reuse_count`, and `mysql_request_pool_hit_count` fields provide totals. `mysql_operations_dropped` reports any overflow. The profiling hostcall itself is excluded from those totals so repeated snapshots remain comparable.
|
|
|
|
Wasm FastCGI workers retain up to `MYSQL_PERSISTENT_POOL_SIZE` credential-keyed MySQL connections (default `8`; set `0` to disable). UCE calls the client library's connection-reset operation before another request receives a cached connection, clearing transactions, temporary tables, session variables, and selected databases while avoiding a new authentication handshake. Same-request leases continue to share state until request cleanup.
|
|
|
|
:example
|
|
DValue perf = request_perf();
|
|
print(perf.get_type_name() != "invalid" ? "captured a timing snapshot" : "no data", "\n");
|