Get all data for a given strace
GET/projects/ {projectId}/ straces/ {straceId}/
v2
GET
pageinsights-get-strace-data
Request
- straceIdstring (uuid)required
ID of the strace to get the data for.
- projectIdstring (uuid)required
ID of the project the strace belongs to.
Responses
application/json
OK
- Schema documentation
- Example
- JSON Schema
- executedAtstring (date-time)required
- idstring (uuid)required
- resultone of 2 alternativesrequired
{
"executedAt": "2024-11-08T18:07:42.263Z",
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"result": {
"errorMessage": "wrong PHP version"
}
}
{
"properties": {
"executedAt": {
"format": "date-time",
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"result": {
"oneOf": [
{
"properties": {
"errorMessage": {
"example": "wrong PHP version",
"type": "string"
}
},
"required": [
"errorMessage"
],
"type": "object"
},
{
"properties": {
"actualUrl": {
"example": "https://www.mittwald.de/~b",
"type": "string"
},
"dbQueries": {
"items": {
"properties": {
"query": {
"description": "The whole DB query.",
"example": "SELECT * FROM my_table;",
"type": "string"
},
"stats": {
"properties": {
"kernelMs": {
"description": "Elapsed kernel space time in milliseconds.",
"example": 1.2345,
"type": "number"
},
"occurrences": {
"description": "The number of times this group occurred.",
"example": 25,
"type": "integer"
},
"syscallCount": {
"description": "Syscall count.",
"example": 4321,
"type": "integer"
},
"userspaceMs": {
"description": "Elapsed user space time in milliseconds.",
"example": 1.2345,
"type": "number"
}
},
"required": [
"kernelMs",
"userspaceMs",
"syscallCount",
"occurrences"
],
"type": "object"
},
"warnLevel": {
"description": "Alerts when the time, syscall count or occurrence count of this group are abnormal.",
"enum": [
"NO",
"WARN",
"SEVERE"
],
"type": "string"
}
},
"required": [
"query",
"stats",
"warnLevel"
],
"type": "object"
},
"type": "array"
},
"dbStats": {
"properties": {
"kernelMs": {
"description": "Elapsed kernel space time in milliseconds.",
"example": 1.2345,
"type": "number"
},
"occurrences": {
"description": "The number of times this group occurred.",
"example": 25,
"type": "integer"
},
"syscallCount": {
"description": "Syscall count.",
"example": 4321,
"type": "integer"
},
"userspaceMs": {
"description": "Elapsed user space time in milliseconds.",
"example": 1.2345,
"type": "number"
}
},
"required": [
"kernelMs",
"userspaceMs",
"syscallCount",
"occurrences"
],
"type": "object"
},
"fileOps": {
"items": {
"properties": {
"filename": {
"example": "my_file.php",
"type": "string"
},
"filepath": {
"example": "/html/my-project",
"type": "string"
},
"stats": {
"properties": {
"kernelMs": {
"description": "Elapsed kernel space time in milliseconds.",
"example": 1.2345,
"type": "number"
},
"occurrences": {
"description": "The number of times this group occurred.",
"example": 25,
"type": "integer"
},
"syscallCount": {
"description": "Syscall count.",
"example": 4321,
"type": "integer"
},
"userspaceMs": {
"description": "Elapsed user space time in milliseconds.",
"example": 1.2345,
"type": "number"
}
},
"required": [
"kernelMs",
"userspaceMs",
"syscallCount",
"occurrences"
],
"type": "object"
},
"warnLevel": {
"description": "Alerts when the time, syscall count or occurrence count of this group are abnormal.",
"enum": [
"NO",
"WARN",
"SEVERE"
],
"type": "string"
}
},
"required": [
"stats",
"warnLevel"
],
"type": "object"
},
"type": "array"
},
"fileOpsStats": {
"properties": {
"kernelMs": {
"description": "Elapsed kernel space time in milliseconds.",
"example": 1.2345,
"type": "number"
},
"occurrences": {
"description": "The number of times this group occurred.",
"example": 25,
"type": "integer"
},
"syscallCount": {
"description": "Syscall count.",
"example": 4321,
"type": "integer"
},
"userspaceMs": {
"description": "Elapsed user space time in milliseconds.",
"example": 1.2345,
"type": "number"
}
},
"required": [
"kernelMs",
"userspaceMs",
"syscallCount",
"occurrences"
],
"type": "object"
},
"miscStats": {
"properties": {
"kernelMs": {
"description": "Elapsed kernel space time in milliseconds.",
"example": 1.2345,
"type": "number"
},
"occurrences": {
"description": "The number of times this group occurred.",
"example": 25,
"type": "integer"
},
"syscallCount": {
"description": "Syscall count.",
"example": 4321,
"type": "integer"
},
"userspaceMs": {
"description": "Elapsed user space time in milliseconds.",
"example": 1.2345,
"type": "number"
}
},
"required": [
"kernelMs",
"userspaceMs",
"syscallCount",
"occurrences"
],
"type": "object"
},
"networkingOps": {
"items": {
"properties": {
"connectionType": {
"enum": [
"UNKNOWN",
"PRIVATE",
"EXTERNAL"
],
"type": "string"
},
"description": {
"description": "A short description of the network connection to provide additional context.",
"type": "string"
},
"ip": {
"description": "IP address to which a connection was established.",
"type": "string"
},
"port": {
"description": "Port to which a connection was established.",
"type": "integer"
},
"stats": {
"properties": {
"kernelMs": {
"description": "Elapsed kernel space time in milliseconds.",
"example": 1.2345,
"type": "number"
},
"occurrences": {
"description": "The number of times this group occurred.",
"example": 25,
"type": "integer"
},
"syscallCount": {
"description": "Syscall count.",
"example": 4321,
"type": "integer"
},
"userspaceMs": {
"description": "Elapsed user space time in milliseconds.",
"example": 1.2345,
"type": "number"
}
},
"required": [
"kernelMs",
"userspaceMs",
"syscallCount",
"occurrences"
],
"type": "object"
},
"warnLevel": {
"description": "Alerts when the time, syscall count or occurrence count of this group are abnormal.",
"enum": [
"NO",
"WARN",
"SEVERE"
],
"type": "string"
}
},
"required": [
"ip",
"port",
"description",
"connectionType",
"stats",
"warnLevel"
],
"type": "object"
},
"type": "array"
},
"networkingStats": {
"properties": {
"kernelMs": {
"description": "Elapsed kernel space time in milliseconds.",
"example": 1.2345,
"type": "number"
},
"occurrences": {
"description": "The number of times this group occurred.",
"example": 25,
"type": "integer"
},
"syscallCount": {
"description": "Syscall count.",
"example": 4321,
"type": "integer"
},
"userspaceMs": {
"description": "Elapsed user space time in milliseconds.",
"example": 1.2345,
"type": "number"
}
},
"required": [
"kernelMs",
"userspaceMs",
"syscallCount",
"occurrences"
],
"type": "object"
},
"slowdownFactor": {
"description": "Shows how much slower the websites TTFB was when it got traced (1.0 = 100% = same TTFB).",
"example": 1.5,
"type": "number"
},
"ttfbMs": {
"description": "Time to first byte in milliseconds while tracing the website.",
"example": 1532,
"type": "integer"
}
},
"required": [
"actualUrl",
"ttfbMs",
"slowdownFactor",
"fileOpsStats",
"networkingStats",
"dbStats",
"miscStats",
"fileOps",
"networkingOps",
"dbQueries"
],
"type": "object"
}
]
}
},
"required": [
"id",
"executedAt",
"result"
],
"type": "object"
}
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/projects/f0f86186-0a5a-45b2-aa33-502777496347/straces/f0f86186-0a5a-45b2-aa33-502777496347
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.pageInsights.pageinsightsGetStraceData({
"straceId": "f0f86186-0a5a-45b2-aa33-502777496347",
"projectId": "f0f86186-0a5a-45b2-aa33-502777496347"
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\PageInsights\GetStraceData\GetStraceDataRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new GetStraceDataRequest(
straceId: "f0f86186-0a5a-45b2-aa33-502777496347",
projectId: "f0f86186-0a5a-45b2-aa33-502777496347"
));
$response = $client->pageInsights()->getStraceData($request);
var_dump($response->getBody();