- API-Referenz
- Page Insights
- Get all data for a given strace
Get all data for a given strace
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
OK
- executedAtstring (date-time)required
- idstring (uuid)required
- resulteine von 2 Alternativenrequired
- Alternativeobject
- errorMessagestringrequired
- Alternativeobject
- actualUrlstringrequired
- dbQueriesArray von objectrequired
- Array[
- *object
- querystringrequired
The whole DB query.
- statsobjectrequired
- kernelMsnumberrequired
Elapsed kernel space time in milliseconds.
- occurrencesintegerrequired
The number of times this group occurred.
- syscallCountintegerrequired
Syscall count.
- userspaceMsnumberrequired
Elapsed user space time in milliseconds.
- warnLevelstring (einer von: NO, WARN, SEVERE)required
Alerts when the time, syscall count or occurrence count of this group are abnormal.
]
- dbStatsobjectrequired
- kernelMsnumberrequired
Elapsed kernel space time in milliseconds.
- occurrencesintegerrequired
The number of times this group occurred.
- syscallCountintegerrequired
Syscall count.
- userspaceMsnumberrequired
Elapsed user space time in milliseconds.
- fileOpsArray von objectrequired
- Array[
- *object
- filenamestring
- filepathstring
- statsobjectrequired
- kernelMsnumberrequired
Elapsed kernel space time in milliseconds.
- occurrencesintegerrequired
The number of times this group occurred.
- syscallCountintegerrequired
Syscall count.
- userspaceMsnumberrequired
Elapsed user space time in milliseconds.
- warnLevelstring (einer von: NO, WARN, SEVERE)required
Alerts when the time, syscall count or occurrence count of this group are abnormal.
]
- fileOpsStatsobjectrequired
- kernelMsnumberrequired
Elapsed kernel space time in milliseconds.
- occurrencesintegerrequired
The number of times this group occurred.
- syscallCountintegerrequired
Syscall count.
- userspaceMsnumberrequired
Elapsed user space time in milliseconds.
- miscStatsobjectrequired
- kernelMsnumberrequired
Elapsed kernel space time in milliseconds.
- occurrencesintegerrequired
The number of times this group occurred.
- syscallCountintegerrequired
Syscall count.
- userspaceMsnumberrequired
Elapsed user space time in milliseconds.
- networkingOpsArray von objectrequired
- Array[
- *object
- connectionTypestring (einer von: UNKNOWN, PRIVATE, EXTERNAL)required
- descriptionstringrequired
A short description of the network connection to provide additional context.
- ipstringrequired
IP address to which a connection was established.
- portintegerrequired
Port to which a connection was established.
- statsobjectrequired
- kernelMsnumberrequired
Elapsed kernel space time in milliseconds.
- occurrencesintegerrequired
The number of times this group occurred.
- syscallCountintegerrequired
Syscall count.
- userspaceMsnumberrequired
Elapsed user space time in milliseconds.
- warnLevelstring (einer von: NO, WARN, SEVERE)required
Alerts when the time, syscall count or occurrence count of this group are abnormal.
]
- networkingStatsobjectrequired
- kernelMsnumberrequired
Elapsed kernel space time in milliseconds.
- occurrencesintegerrequired
The number of times this group occurred.
- syscallCountintegerrequired
Syscall count.
- userspaceMsnumberrequired
Elapsed user space time in milliseconds.
- slowdownFactornumberrequired
Shows how much slower the websites TTFB was when it got traced (1.0 = 100% = same TTFB).
- ttfbMsintegerrequired
Time to first byte in milliseconds while tracing the website.
Content-Type: application/json
{
"executedAt": "1985-10-26T01:21:00.000Z",
"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"
}
Validation Error caused by invalid input data in the request
- type"ValidationError"required
- messagestring
- validationErrorsArray von objectrequired
- Array[
- *object
- messagestringrequired
The standard error message
- pathstringrequired
The path to the part of the data that was validated. JavaScript property access notation (e.g., ".prop[1].subProp") is used.
- typestringrequired
ajv validation error type (e.g. "format", "required", "type") or own validation error types
- contextobject
The object with the additional information about the error that can be used to create custom error messages. Keys depend on the type that failed validation (e.g. "missingProperty" for type "required")
- *string
]
Content-Type: application/json
{
"type": "ValidationError",
"message": "Validation failed",
"validationErrors": [
{
"message": "should be string",
"path": ".address.street",
"type": "format",
"context": {
"format": "email"
}
}
]
}
{
"type": "object",
"required": [
"type",
"validationErrors"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ValidationError"
]
},
"message": {
"type": "string",
"example": "Validation failed"
},
"validationErrors": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"path",
"type"
],
"properties": {
"message": {
"type": "string",
"description": "The standard error message",
"example": "should be string"
},
"path": {
"type": "string",
"description": "The path to the part of the data that was validated. JavaScript property access notation (e.g., \".prop[1].subProp\") is used.\n",
"example": ".address.street"
},
"type": {
"type": "string",
"description": "ajv validation error type (e.g. \"format\", \"required\", \"type\") or own validation error types",
"example": "format"
},
"context": {
"type": "object",
"example": {
"format": "email"
},
"description": "The object with the additional information about the error that can be used to create custom error messages. Keys depend on the\ntype that failed validation (e.g. \"missingProperty\" for type \"required\")\n",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Your request ran into a rate limit. You have to wait until rate limit expires
- messagestring
- typestring
Content-Type: application/json
{
"message": "too many requests",
"type": "RateLimitError"
}
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "too many requests"
},
"type": {
"type": "string",
"example": "RateLimitError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Nutzungsbeispiele
$ 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();