opensearch-project / query-insights-dashboards

Apache License 2.0
1 stars 3 forks source link

remove records with grouping #26

Closed ansjcy closed 1 week ago

ansjcy commented 2 weeks ago

Description

Remove records with grouping enabled

Testing

➜  ~ curl -X GET "localhost:9200/_insights/top_queries?pretty"
{
  "top_queries" : [
    {
      "timestamp" : 1730939434086,
      "task_resource_usages" : [
        {
          "action" : "indices:data/read/search[phase/query]",
          "taskId" : 336,
          "parentTaskId" : 335,
          "nodeId" : "GMGKkdcNTzCi2f_ZTanWQg",
          "taskResourceUsage" : {
            "cpu_time_in_nanos" : 3696000,
            "memory_in_bytes" : 34544
          }
        },
        {
          "action" : "indices:data/read/search",
          "taskId" : 335,
          "parentTaskId" : -1,
          "nodeId" : "GMGKkdcNTzCi2f_ZTanWQg",
          "taskResourceUsage" : {
            "cpu_time_in_nanos" : 259000,
            "memory_in_bytes" : 3720
          }
        }
      ],
      "labels" : { },
      "source" : {
        "size" : 20,
        "query" : {
          "term" : {
            "user.id" : {
              "value" : "cyji",
              "boost" : 1.0
            }
          }
        }
      },
      "total_shards" : 1,
      "phase_latency_map" : {
        "expand" : 0,
        "query" : 7,
        "fetch" : 0
      },
      "indices" : [
        "my-index-0"
      ],
      "search_type" : "query_then_fetch",
      "node_id" : "GMGKkdcNTzCi2f_ZTanWQg",
      "query_hashcode" : "5b736559acb94cbe940c73e4fe19245",
      "measurements" : {
        "memory" : {
          "number" : 76528,
          "count" : 2,
          "aggregationType" : "AVERAGE"
        },
        "cpu" : {
          "number" : 4701000,
          "count" : 2,
          "aggregationType" : "AVERAGE"
        },
        "latency" : {
          "number" : 10,
          "count" : 2,
          "aggregationType" : "AVERAGE"
        }
      }
    }
  ]
}

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

ansjcy commented 2 weeks ago

Note: there will be conflicts with https://github.com/opensearch-project/query-insights-dashboards/pull/21/files