Skip to main content

process_query.go

process_query.go - Overview

  1. Overview This file defines a ProcessesTableListQuery variable that holds a pre-configured query for fetching and displaying process-related metrics in a table format. The query is designed to retrieve CPU and memory usage data for processes.

  2. Detailed Documentation

ProcessesTableListQuery

  • Purpose: Defines a composite query to fetch and display process CPU and memory usage in a table format.
  • Type: v3.QueryRangeParamsV3
  • Fields:
    • CompositeQuery: A pointer to a v3.CompositeQuery struct containing the details of the composite query.
      • BuilderQueries: A map of v3.BuilderQuery structs, each defining a sub-query.
        • "A": Query for CPU usage.
          • QueryName: "A"
          • DataSource: v3.DataSourceMetrics
          • AggregateAttribute: Specifies the CPU metric to aggregate.
            • Key: The CPU metric name (obtained from metricNamesForProcesses["cpu"]).
            • DataType: v3.AttributeKeyDataTypeFloat64
          • Temporality: v3.Cumulative
          • Filters: An empty filter set.
          • GroupBy: Groups the results by process ID.
            • Key: The process ID attribute key (processPIDAttrKey).
            • DataType: v3.AttributeKeyDataTypeString
            • Type: v3.AttributeKeyTypeResource
          • Expression: "A"
          • ReduceTo: v3.ReduceToOperatorAvg
          • TimeAggregation: v3.TimeAggregationRate
          • SpaceAggregation: v3.SpaceAggregationSum
          • Disabled: true
        • "F1": Represents formatted CPU usage.
          • QueryName: "F1"
          • Expression: "A"
          • Legend: "Process CPU Usage (%)"
          • Filters: An empty filter set.
        • "C": Query for memory usage.
          • QueryName: "C"
          • DataSource: v3.DataSourceMetrics
          • AggregateAttribute: Specifies the memory metric to aggregate.
            • Key: The memory metric name (obtained from metricNamesForProcesses["memory"]).
            • DataType: v3.AttributeKeyDataTypeFloat64
          • Temporality: v3.Cumulative
          • Filters: An empty filter set.
          • GroupBy: Groups the results by process ID.
            • Key: The process ID attribute key (processPIDAttrKey).
            • DataType: v3.AttributeKeyDataTypeString
            • Type: v3.AttributeKeyTypeResource
          • Expression: "C"
          • ReduceTo: v3.ReduceToOperatorAvg
          • TimeAggregation: v3.TimeAggregationAvg
          • SpaceAggregation: v3.SpaceAggregationSum
          • Disabled: false
      • PanelType: v3.PanelTypeTable
      • QueryType: v3.QueryTypeBuilder
    • Version: "v4"
    • FormatForWeb: true
  1. Code Examples None

  2. Clarity and Accuracy The documentation is derived directly from the code and aims to accurately represent the structure and purpose of the defined query.

  3. Markdown & MDX Perfection The markdown syntax is correct, and all special characters are properly escaped or enclosed in code blocks.

  4. Edge Cases To Avoid Breaking MDX All potential MDX breaking cases are avoided.

  5. Getting Started Relevance Include in Getting Started: NO