用于性能测试结果的 Fuchsiaperf 格式

本文档介绍了 Fuchsia 基准测试结果必须遵循的 JSON 架构,才能上传到性能信息中心。

JSON 说明

[
    {
        "label":       string     // Name of the test case in the performance dashboard.
        "test_suite":  string     // Name of the test suite in the performance dashboard.
        "unit":        string     // One of the supported units (see below)
        "values":      [v1, v2..] // Numeric values collected in this test case
    },
    {
        ...
    }
]

支持的单位

为了将基准结果转换为性能信息中心所需的格式,unit 必须是以下字符串之一,用于描述结果的 values 的单位。

  • nanosecondsns
  • millisecondsms
  • bytes/second
  • bytes

示例

[
    {
        "label": "Channel/WriteRead/64bytes",
        "test_suite": "fuchsia.microbenchmarks",
        "unit": "nanoseconds",
        "values": [105.45, 697.916667, 672.743056]
    },
    {
        "label": "Channel/WriteRead/1024bytes",
        "test_suite": "fuchsia.microbenchmarks",
        "unit": "nanoseconds",
        "values": [102.23, 1004.340278, 906.250000]
    }
]

另请参阅