效能測試結果的 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 單位。

  • nanoseconds」或「ns
  • 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]
    }
]

另請參閱