Link Search Menu Expand Document Documentation Menu

指标记录

OpenSearch Benchmark 将指标存储在 benchmark-metrics-* 索引中。每月都会创建一个新索引。以下是存储在 benchmark-metrics-2023-08 索引中的一个指标记录示例:

{
  "_index": "benchmark-metrics-2023-08",
  "_id": "UiNY4YkBpMtdJ7uj2rUe",
  "_version": 1,
  "_score": null,
  "_source": {
    "@timestamp": 1691702842821,
    "relative-time-ms": 65.90720731765032,
    "test-execution-id": "8c43ee4c-cb34-494b-81b2-181be244f832",
    "test-execution-timestamp": "20230810T212711Z",
    "environment": "local",
    "workload": "geonames",
    "test_procedure": "append-no-conflicts",
    "provision-config-instance": "external",
    "name": "service_time",
    "value": 607.8001195564866,
    "unit": "ms",
    "sample-type": "normal",
    "meta": {
      "source_revision": "unknown",
      "distribution_version": "1.1.0",
      "distribution_flavor": "oss",
      "index": "geonames",
      "took": 13,
      "success": true,
      "success-count": 125,
      "error-count": 0
    },
    "task": "index-append",
    "operation": "index-append",
    "operation-type": "bulk"
  },
  "fields": {
    "@timestamp": [
      "2023-08-10T21:27:22.821Z"
    ],
    "test-execution-timestamp": [
      "2023-08-10T21:27:11.000Z"
    ]
  },
  "highlight": {
    "workload": [
      "@opensearch-dashboards-highlighted-field@geonames@/opensearch-dashboards-highlighted-field@"
    ],
    "meta.index": [
      "@opensearch-dashboards-highlighted-field@geonames@/opensearch-dashboards-highlighted-field@"
    ]
  },
  "sort": [
    1691702831000
  ]
}

指标记录的 _source 部分中的以下字段可在 opensearch-benchmarks-metrics-* 文件中配置。

@timestamp

自纪元以来,样本采集时的时间戳,以毫秒为单位。对于与请求相关的指标,例如 latency(延迟)或 service_time(服务时间),这是 OpenSearch Benchmark 发出请求时的时间戳。

relative-time-ms

自基准测试开始以来的相对时间,以毫秒为单位。这对于比较多个测试中的时间序列图非常有用。例如,您可以比较多个测试中随时间变化的索引吞吐量。

test-execution-id

一个 UUID,每次调用工作负载时都会变化。它旨在对基准测试运行的所有样本进行分组。

test-execution-timestamp

调用工作负载时的时间戳(始终为 UTC)。

environment

environment 描述了指标记录的来源。这在最初配置 OpenSearch Benchmark 时定义。您可以为不同的基准测试使用不同的环境,但将指标记录存储在同一个索引中。

workload, test_procedure, provision-config-instance

生成指标的工作负载、测试过程和配置实例。

name, value, unit

实际的指标名称和值,以及可选的单位。根据指标的性质,它要么由 OpenSearch Benchmark 定期采样(例如,CPU 利用率或查询延迟),要么只测量一次(例如,索引的最终大小)。

sample-type

通过将其设置为 warmup(预热)或 normal(正常)来确定是否将基准测试配置为在预热模式下运行。只有 normal 样本才会被计入报告结果。

meta

每个指标记录的元信息,包括以下内容:

  • CPU 信息:物理和逻辑核心的数量以及型号名称。
  • 操作系统信息:操作系统的名称和版本。
  • 主机名。
  • 节点名称:OpenSearch Benchmark 预置集群时赋予每个节点的唯一名称。
  • 源修订:被基准测试的 OpenSearch 版本的 Git 哈希值。
  • 分发版本:被基准测试的 OpenSearch 的分发版本。
  • 自定义标签:您可以使用命令行标志 --user-tags 定义自定义标签。标签以 tag_ 为前缀,以避免与 OpenSearch Benchmark 内部标签意外冲突。
  • 操作特定信息:操作的可选子结构。对于批量请求,这可能是文档数量;对于搜索,则是命中次数。

根据指标记录,某些元信息可能会缺失。

后续步骤

  • 有关如何访问 OpenSearch Benchmark 指标的更多信息,请参阅指标
  • 有关 OpenSearch Benchmark 中存储的指标的更多信息,请参阅指标键