Skip to main content

Get all data for a given strace

GET/v2/projects/{projectId}/straces/{straceId}
API version
v2
Request method
GET
Operation ID
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​

Format
application/json
Description

OK

  • executedAtstring (date-time)required
  • idstring (uuid)required
  • resultone of 2 alternativesrequired
    • Alternativeobject
      • errorMessagestringrequired
    • Alternativeobject
      • actualUrlstringrequired
      • dbQueriesarray of 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 (one of: 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 of 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 (one of: 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 of objectrequired
        • Array[
          • *object
            • connectionTypestring (one of: 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 (one of: 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"
}

Usage examples​

$ 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();

On this page