IBM Db2 Monitoring timespent API
The Monitoring timespent API from IBM Db2 — 1 operation(s) for monitoring timespent.
The Monitoring timespent API from IBM Db2 — 1 operation(s) for monitoring timespent.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/ibm-db2:ibm-db2-monitoring-timespent-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Ibm Db2 Monitoring timespent API
version: '4'
termsOfService: http://www.ibm.com/software/sla/sladb.nsf
x-github: https://github.ibm.com/cloud-api-docs/db2-saas
x-github-issues: https://github.ibm.com/cloud-api-docs/db2-saas/issues/new
x-last-updated: '2025-06-25'
x-sdk-supported-languages:
- java
- node
- go
- python
x-try-it-out-enabled: true
description: 'Operations tagged Monitoring timespent across 2 of this provider''s published API definitions: ibm-db2-db2-on-cloud-v4-openapi.json, ibm-db2-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://_HOSTNAME_VARIABLE_/dbapi/v4
security:
- authToken: []
- deploymentId: []
tags:
- name: Monitoring timespent
paths:
/metrics/timespent:
get:
operationId: GetTimespent
summary: Get the time spent in each operation. **DB ADMIN ONLY**
description: Get the time spent in each operation for a specified time frame.
parameters:
- name: X-DB-Profile
in: header
description: Database profile name.
required: true
schema:
type: string
- name: start
in: query
description: Start timestamp.
required: true
schema:
type: integer
- name: end
in: query
description: End timestamp.
required: true
schema:
type: integer
tags:
- Monitoring timespent
responses:
'200':
description: Return the time spent in each operation for a specified time frame.
content:
application/json:
schema:
$ref: '#/components/schemas/Timespent'
'404':
description: Database profile not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorContainer'
default:
description: Error payload.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorContainer'
x-sdk-operations:
request-examples:
go:
- name: Example request
example:
- type: code
source:
- "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{HOSTNAME}/dbapi/v4/metrics/timespent?start=1546272000000&end=1546272300000\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"x-db-profile\", \"SOME_STRING_VALUE\")\n\treq.Header.Add(\"authorization\", \"Bearer {AUTH_TOKEN}\")\n\treq.Header.Add(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
java:
- name: Example request
example:
- type: code
source:
- "OkHttpClient client = new OkHttpClient();\n\nRequest request = new Request.Builder()\n .url(\"https://{HOSTNAME}/dbapi/v4/metrics/timespent?start=1546272000000&end=1546272300000\")\n .get()\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"x-db-profile\", \"SOME_STRING_VALUE\")\n .addHeader(\"authorization\", \"Bearer {AUTH_TOKEN}\")\n .addHeader(\"x-deployment-id\", \"{DEPLOYMENT_ID}\")\n .build();\n\nResponse response = client.newCall(request).execute();"
node:
- name: Example request
example:
- type: code
source:
- "var http = require(\"https\");\n\nvar options = {\n \"method\": \"GET\",\n \"hostname\": \"{HOSTNAME}\",\n \"port\": null,\n \"path\": \"/dbapi/v4/metrics/timespent?start=1546272000000&end=1546272300000\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"x-db-profile\": \"SOME_STRING_VALUE\",\n \"authorization\": \"Bearer {AUTH_TOKEN}\",\n \"x-deployment-id\": \"{DEPLOYMENT_ID}\"\n }\n};\n\nvar req = http.request(options, function (res) {\n var chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n var body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();"
python:
- name: Example request
example:
- type: code
source:
- "import http.client\n\nconn = http.client.HTTPSConnection(\"{HOSTNAME}\")\n\nheaders = {\n 'content-type': \"application/json\",\n 'x-db-profile': \"SOME_STRING_VALUE\",\n 'authorization': \"Bearer {AUTH_TOKEN}\",\n 'x-deployment-id': \"{DEPLOYMENT_ID}\"\n }\n\nconn.request(\"GET\", \"/dbapi/v4/metrics/timespent?start=1546272000000&end=1546272300000\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))"
curl:
- name: Example request
example:
- type: code
source:
- "curl -X GET \\\n 'https://{HOSTNAME}/dbapi/v4/metrics/timespent?start=1546272000000&end=1546272300000' \\\n -H 'authorization: Bearer {AUTH_TOKEN}' \\\n -H 'content-type: application/json' \\\n -H 'x-db-profile: SOME_STRING_VALUE' \\\n -H 'x-deployment-id: {DEPLOYMENT_ID}'"
servers:
- url: https://_HOSTNAME_VARIABLE_/dbapi/v4
components:
schemas:
Timespent:
type: object
description: Timespent.
required:
- count
- metadata
- timeseries
properties:
count:
type: integer
format: int32
description: Number of time spent.
metadata:
$ref: '#/components/schemas/TimespentMeta'
timeseries:
type: array
items:
$ref: '#/components/schemas/TimespentData'
ErrorContainer:
type: object
description: Error response containing one or more error messages
required:
- trace
- errors
properties:
trace:
type: string
description: Unique ID assigned by the server that identifies the request that generated the error
errors:
type: array
description: List of errors
items:
$ref: '#/components/schemas/ErrorModel'
ErrorModel:
type: object
description: Error information
required:
- code
- message
properties:
code:
type: string
description: Error code succinctly identifying the problem
enum:
- authentication_failure
- database_error
- forbidden
- internal_server_error
- invalid_authentication_token
- invalid_content_type
- invalid_api_endpoint
- invalid_parameters
- invalid_request_payload
- not_found
- resource_already_exists
- session_expired
- unavailable
message:
type: string
description: Explanation of the problem and possible solutions
target:
$ref: '#/components/schemas/ErrorTargetModel'
more_info:
type: string
description: URL where more information about the error can be found (if available)
TimespentMeta:
type: object
description: Timespent meta data.
required:
- sqlexecutiontime_percent
- iotime_percent
- lockwaittime_percent
- otherprocessingtime_percent
- otherwaittime_percent
properties:
sqlexecutiontime_percent:
type: array
description: Sql execution time.
items:
type: string
example:
- total_section_proc_time_percent
- total_section_sort_proc_time_percent
- total_routine_user_code_proc_time_percent
iotime_percent:
type: array
description: IO time.
items:
type: string
example:
- pool_read_time_percent
- pool_write_time_percent
- direct_read_time_percent
- direct_write_time_percent
lockwaittime_percent:
type: array
description: Lock wait time.
items:
type: string
example:
- lock_wait_time_percent
- lock_wait_time_global_percent
otherprocessingtime_percent:
type: array
description: Other processing time.
items:
type: string
example:
- total_compile_proc_time_percent
- total_implicit_compile_proc_time_percent
- total_load_proc_time_percent
- total_reorg_proc_time_percent
- total_runstats_proc_time_percent
- total_connect_request_proc_time_percent
- total_commit_proc_time_percent
- total_rollback_proc_time_percent
- total_backup_proc_time_percent
- total_index_build_proc_time_percent
otherwaittime_percent:
type: array
description: Other wait time.
items:
type: string
example:
- agent_wait_time_percent
- wlm_queue_time_total_percent
- log_buffer_wait_time_percent
- log_disk_wait_time_percent
- tcpip_wait_time_percent
- ipc_wait_time_percent
- audit_subsystem_wait_time_percent
- audit_file_write_wait_time_percent
- diaglog_write_wait_time_percent
- evmon_wait_time_percent
- total_extended_latch_wait_time_percent
- prefetch_wait_time_percent
- comm_exit_wait_time_percent
- ida_wait_time_percent
- reclaim_wait_time_percent
- spacemappage_reclaim_wait_time_percent
- fed_wait_time_percent
TimespentData:
type: object
description: Timespent data.
required:
- timestamp
- interval
- sqlexecutiontime_percent
- iotime_percent
- lockwaittime_percent
- otherprocessingtime_percent
- otherwaittime_percent
- total_section_proc_time_percent
- total_section_sort_proc_time_percent
- total_routine_user_code_proc_time_percent
- pool_read_time_percent
- pool_write_time_percent
- direct_read_time_percent
- direct_write_time_percent
- lock_wait_time_percent
- lock_wait_time_global_percent
- total_compile_proc_time_percent
- total_implicit_compile_proc_time_percent
- total_load_proc_time_percent
- total_reorg_proc_time_percent
- total_runstats_proc_time_percent
- total_connect_request_proc_time_percent
- total_commit_proc_time_percent
- total_rollback_proc_time_percent
- total_backup_proc_time_percent
- total_index_build_proc_time_percent
- agent_wait_time_percent
- wlm_queue_time_total_percent
- log_buffer_wait_time_percent
- log_disk_wait_time_percent
- tcpip_wait_time_percent
- ipc_wait_time_percent
- audit_subsystem_wait_time_percent
- audit_file_write_wait_time_percent
- diaglog_write_wait_time_percent
- evmon_wait_time_percent
- total_extended_latch_wait_time_percent
- prefetch_wait_time_percent
- comm_exit_wait_time_percent
- ida_wait_time_percent
- reclaim_wait_time_percent
- spacemappage_reclaim_wait_time_percent
- fed_wait_time_percent
properties:
timestamp:
type: integer
format: int64
description: Timestamp of this data been collected.
interval:
type: integer
format: int64
description: Interval.
sqlexecutiontime_percent:
type: number
format: double
description: Sql execution time.
total_section_proc_time_percent:
type: number
format: double
description: Total section proc time.
total_section_sort_proc_time_percent:
type: number
format: double
description: Total section sort proc time.
total_routine_user_code_proc_time_percent:
type: number
format: double
description: Total routine user_code proc time.
iotime_percent:
type: number
format: double
description: IO time.
pool_read_time_percent:
type: number
format: double
description: Pool read time.
pool_write_time_percent:
type: number
format: double
description: Pool write time.
direct_read_time_percent:
type: number
format: double
description: Direct read time.
direct_write_time_percent:
type: number
format: double
description: Direct write time percent.
lockwaittime_percent:
type: number
format: double
description: Lock wait time.
lock_wait_time_percent:
type: number
format: double
description: Lock wait time.
lock_wait_time_global_percent:
type: number
format: double
description: Lock wait time global.
otherprocessingtime_percent:
type: number
format: double
description: Other processing time.
total_compile_proc_time_percent:
type: number
format: double
description: Total compile proc time.
total_implicit_compile_proc_time_percent:
type: number
format: double
description: Total implicit compile proc time.
total_load_proc_time_percent:
type: number
format: double
description: Total load pro time.
total_reorg_proc_time_percent:
type: number
format: double
description: Total reorg proc time.
total_runstats_proc_time_percent:
type: number
format: double
description: Total runstats proc time.
total_connect_request_proc_time_percent:
type: number
format: double
description: Total connect request proc time.
total_commit_proc_time_percent:
type: number
format: double
description: Total commit proc time.
total_rollback_proc_time_percent:
type: number
format: double
description: Total rollback proc time.
total_backup_proc_time_percent:
type: number
format: double
description: Total backup proc time percent.
total_index_build_proc_time_percent:
type: number
format: double
description: Total index build proc time.
otherwaittime_percent:
type: number
format: double
description: Other wait time.
agent_wait_time_percent:
type: number
format: double
description: Agent wait time.
wlm_queue_time_total_percent:
type: number
format: double
description: Wlm queue time total.
log_buffer_wait_time_percent:
type: number
format: double
description: Log buffer wait time.
log_disk_wait_time_percent:
type: number
format: double
description: Log disk wait time.
tcpip_wait_time_percent:
type: number
format: double
description: Tcpip wait time.
ipc_wait_time_percent:
type: number
format: double
description: Ipc wait time.
audit_subsystem_wait_time_percent:
type: number
format: double
description: Audit subsystem wait time.
audit_file_write_wait_time_percent:
type: number
format: double
description: Audit file write wait time.
diaglog_write_wait_time_percent:
type: number
format: double
description: Diaglog write wait time.
evmon_wait_time_percent:
type: number
format: double
description: Evmon wait time.
total_extended_latch_wait_time_percent:
type: number
format: double
description: Total extended latch wait time.
prefetch_wait_time_percent:
type: number
format: double
description: Prefetch wait time.
comm_exit_wait_time_percent:
type: number
format: double
description: Comm exit wait time.
ida_wait_time_percent:
type: number
format: double
description: Ida wait time.
reclaim_wait_time_percent:
type: number
format: double
description: Reclaim wait time.
spacemappage_reclaim_wait_time_percent:
type: number
format: double
description: Spacemappage reclaim wait time.
fed_wait_time_percent:
type: number
format: double
description: Fed wait time.
ErrorTargetModel:
type: object
description: Field or parameter related to an error
required:
- type
- name
properties:
type:
type: string
description: Field type
enum:
- field
- parameter
- header
name:
type: string
description: Name of the problematic field (with dot-syntax if necessary), query parameter, or header
securitySchemes:
authToken:
type: apiKey
in: header
name: Authorization
description: Authorize using **Bearer [access_token]**. The access token can be obtained by authenticating with the **/auth/tokens** endpoint or [use the API key to generate an IAM Bearer Token](https://cloud.ibm.com/docs/account?topic=account-iamtoken_from_apikey).
deploymentId:
type: apiKey
in: header
name: X-Deployment-Id
description: The deployment id of the service, which can be obtained after provision. When providing the deployment id in the header, use URL encoding. For example, ":" should be escaped as "%3A", and "/" should be escaped as "%2F".
x-refined-from:
- ibm-db2-db2-on-cloud-v4-openapi.json
- ibm-db2-openapi.yml