Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add field type cache data to health stats API #193

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

dzane17
Copy link
Collaborator

@dzane17 dzane17 commented Jan 17, 2025

Description

Add field type cache stats to the Query Insights health_stats API.

This enables users to track total hit count, miss count, entry count, and cache memory size.

% curl -XGET "http://localhost:9200/_insights/health_stats?pretty"                     
{
  "WcXrhPnVRdmjADJAFf98aw" : {
    "ThreadPoolInfo" : {
      "query_insights_executor" : {
        "type" : "scaling",
        "core" : 1,
        "max" : 5,
        "keep_alive" : "5m",
        "queue_size" : -1
      }
    },
    "QueryRecordsQueueSize" : 0,
    "TopQueriesHealthStats" : {
      "cpu" : {
        "TopQueriesHeapSize" : 0,
        "QueryGroupCount_Total" : 0,
        "QueryGroupCount_MaxHeap" : 0
      },
      "memory" : {
        "TopQueriesHeapSize" : 0,
        "QueryGroupCount_Total" : 0,
        "QueryGroupCount_MaxHeap" : 0
      },
      "latency" : {
        "TopQueriesHeapSize" : 2,
        "QueryGroupCount_Total" : 2,
        "QueryGroupCount_MaxHeap" : 0
      }
    },
    "FieldTypeCacheStats" : {
      "size_in_bytes" : 336,
      "entry_count" : 3,
      "evictions" : 1,
      "hit_count" : 5,
      "miss_count" : 4
    }
  }
}

Issues Resolved

Resolves #146

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.

@dzane17 dzane17 changed the title Add field type cache stats Add field type cache data to health stats API Jan 17, 2025
@dzane17 dzane17 marked this pull request as ready for review January 17, 2025 18:43
Signed-off-by: David Zane <davizane@amazon.com>
@jainankitk jainankitk merged commit 47dc89e into opensearch-project:main Jan 23, 2025
12 checks passed
@dzane17 dzane17 deleted the cache-stats branch January 23, 2025 19:37
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 23, 2025
Signed-off-by: David Zane <davizane@amazon.com>
(cherry picked from commit 47dc89e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
deshsidd pushed a commit that referenced this pull request Jan 24, 2025
(cherry picked from commit 47dc89e)

Signed-off-by: David Zane <davizane@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Add stats for field name to field type mapping cache
2 participants