The execution profile log records where the time of an execution went. On completion of a result set one JSON object is appended to a file in NDJSON format, holding facts such as the session, the statement, the data containers addressed, the number of rows and the elapsed, CPU and I/O time of the individual execution steps. The resulting file can be analysed with Invantive UniversalSQL itself through [[JSON and NDJSON Table (jsonTableSpec)]].
The execution profile log is configured using the following environment variables:
- `INVANTIVE_PROFILE_TO_DISK`: whether to log the execution profile. Defaults to `false`; set to `true` to activate.
- `INVANTIVE_PROFILE_PATH`: the folder to contain the execution profile log. There is no default; nothing is logged as long as no folder is named.
- `INVANTIVE_PROFILE_FILE_NAME`: the name of the file within that folder, optionally with the placeholders listed below. Defaults to `profile-{date}-{applicationname}-{currentprocessid}-{sessionid}.ndjson`. Available from release 27.0.
The same three settings are also available as the driver attributes `invantive-sql-execution-profile-to-disk`, `invantive-sql-execution-profile-disk-path` and `invantive-sql-execution-profile-disk-file-name`, which can be set from the connection string or with a `set` SQL statement as described in [[Invantive UniversalSQL/Service Drivers/Data Dictionary Data Model/Attributes|Attributes]]. The environment variable provides the default of the driver attribute, so a value set on the driver attribute takes precedence.
## File Name
The file name may contain the following placeholders:
- `{date}` and `{time}`: the date as `YYYYMMDD` and the time as `HHMMSS`, both in UTC, at which the file name was determined.
- `{startdate}` and `{starttime}`: the date and the time in UTC at which the operating system process started.
- `{currentprocessid}`: the ID of the operating system process.
- `{sessionid}`: the ID of the Invantive UniversalSQL session which executed the statement.
- `{requestid}`: the ID of the request the execution belongs to. Empty when the application does not identify requests.
- `{applicationname}` and `{applicationversion}`: the name and the version of the Invantive application.
- `{machinename}`: the name of the device.
- `{poolidentityid}`: the pool identity.
- `{licensecontractcode}`: the code of the subscription contract.
Text which is not one of these placeholders is kept unchanged, including a placeholder which is not recognised.
The value names a file and never a path: a folder in the value is removed and the file is always created in the folder named by `INVANTIVE_PROFILE_PATH`. A character which the file system does not allow is replaced by an underscore, and a name which is too long for the file system is shortened while retaining the extension. When the value leaves no file name at all, the default is used instead and message `itgensql800` is logged once.
The file name is determined once per session and reused afterwards, so `{date}` and `{time}` describe the moment logging started rather than the individual execution. A session running past midnight therefore keeps one file. The file in use is reported once as message `itgensql801`.
Retain `{sessionid}` in the file name whenever more than one process can log at the same time. Appending is coordinated within one process, but not between processes: when two processes write to one file, their executions end up interleaved in it.
## Up to and Including Release 26.0
The file is always named `test.ndjson` and cannot be varied. Every session, process and product on the device appends to that one file.