> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixpeek.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyze Bottlenecks

> Identify performance bottlenecks.

Analyzes profiling data to identify the biggest bottlenecks,
ranked by total time spent.

**Use Cases:**
- Find what's slowing down your pipelines
- Prioritize optimization efforts
- Monitor bottleneck trends

**Ranking:**
- Sorted by total time spent (sum across all executions)
- Shows percentage of total execution time
- Includes execution count and average time

**Example:**
```bash
GET /v1/analytics/performance/engine/bottlenecks?hours=24&limit=10
```



## OpenAPI

````yaml get /v1/analytics/performance/engine/bottlenecks
openapi: 3.1.0
info:
  title: Mixpeek API
  description: >-
    This is the Mixpeek API, providing access to various endpoints for data
    processing and retrieval.
  termsOfService: https://mixpeek.com/terms
  contact:
    name: Mixpeek Support
    url: https://mixpeek.com/contact
    email: info@mixpeek.com
  version: '0.82'
servers:
  - url: https://api.mixpeek.com
    description: Production
security: []
paths:
  /v1/analytics/performance/engine/bottlenecks:
    get:
      tags:
        - Analytics
        - Analytics - Performance
      summary: Analyze Bottlenecks
      description: |-
        Identify performance bottlenecks.

        Analyzes profiling data to identify the biggest bottlenecks,
        ranked by total time spent.

        **Use Cases:**
        - Find what's slowing down your pipelines
        - Prioritize optimization efforts
        - Monitor bottleneck trends

        **Ranking:**
        - Sorted by total time spent (sum across all executions)
        - Shows percentage of total execution time
        - Includes execution count and average time

        **Example:**
        ```bash
        GET /v1/analytics/performance/engine/bottlenecks?hours=24&limit=10
        ```
      operationId: analyze_bottlenecks_v1_analytics_performance_engine_bottlenecks_get
      parameters:
        - name: hours
          in: query
          required: false
          schema:
            type: integer
            maximum: 168
            minimum: 1
            description: Hours of history
            default: 24
            title: Hours
          description: Hours of history
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 50
            minimum: 1
            description: Number of bottlenecks to return
            default: 10
            title: Limit
          description: Number of bottlenecks to return
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BottleneckResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BottleneckResponse:
      properties:
        time_range:
          $ref: '#/components/schemas/api__analytics__models__TimeRange'
          description: Time range of the analysis
        bottlenecks:
          items:
            $ref: '#/components/schemas/BottleneckAnalysis'
          type: array
          title: Bottlenecks
          description: Ranked list of bottlenecks
        total_time_ms:
          type: number
          title: Total Time Ms
          description: Total execution time across all components
      type: object
      required:
        - time_range
        - bottlenecks
        - total_time_ms
      title: BottleneckResponse
      description: Response for bottleneck analysis.
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Always false for error responses
          default: false
        status:
          type: integer
          title: Status
          description: HTTP status code for this error
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: Error details payload
      type: object
      required:
        - status
        - error
      title: ErrorResponse
      description: Error response model.
      examples:
        - error:
            details:
              id: ns_123
              resource: namespace
            message: Namespace not found
            type: NotFoundError
          status: 404
          success: false
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    api__analytics__models__TimeRange:
      properties:
        start:
          type: string
          format: date-time
          title: Start
          description: Start time (UTC)
        end:
          type: string
          format: date-time
          title: End
          description: End time (UTC)
      type: object
      required:
        - start
        - end
      title: TimeRange
      description: Time range for analytics queries.
    BottleneckAnalysis:
      properties:
        stage_name:
          type: string
          title: Stage Name
          description: Stage name
        component:
          type: string
          title: Component
          description: Component
        execution_count:
          type: integer
          title: Execution Count
          description: Number of executions
        total_time_ms:
          type: number
          title: Total Time Ms
          description: Total time spent
        avg_time_ms:
          type: number
          title: Avg Time Ms
          description: Average time per execution
        pct_of_total:
          type: number
          title: Pct Of Total
          description: Percentage of total execution time
        rank:
          type: integer
          title: Rank
          description: Bottleneck ranking (1 = worst)
      type: object
      required:
        - stage_name
        - component
        - execution_count
        - total_time_ms
        - avg_time_ms
        - pct_of_total
        - rank
      title: BottleneckAnalysis
      description: Bottleneck analysis result.
    ErrorDetail:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable error message
        type:
          type: string
          title: Type
          description: Stable error type identifier (machine-readable)
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: >-
            Fine-grained error code for programmatic handling (e.g.,
            namespace_name_taken, feature_extractor_not_found). Present only
            when consumers may need to branch on a specific error condition.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Optional structured details to help debugging (validation errors,
            IDs, etc.)
      type: object
      required:
        - message
        - type
      title: ErrorDetail
      description: Error detail model.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````