about summary refs log tree commit diff
path: root/benchtests/scripts/benchout.schema.json
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2014-06-11 14:16:29 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2014-06-11 14:16:29 +0530
commit42b1161e8c45df468d1696b43a7820c3ffe29da1 (patch)
tree9f736456fa4b53ccb02b0f9459141f23d31f7db2 /benchtests/scripts/benchout.schema.json
parent4a594c34356b1ae90b69f359fa95e9c4ad8d8694 (diff)
downloadglibc-42b1161e8c45df468d1696b43a7820c3ffe29da1.tar.gz
glibc-42b1161e8c45df468d1696b43a7820c3ffe29da1.tar.xz
glibc-42b1161e8c45df468d1696b43a7820c3ffe29da1.zip
Validate bench.out against a JSON schema
This patch adds a JSON schema for the benchmark output file and also
adds a script that validates the generated output against the schema.
Diffstat (limited to 'benchtests/scripts/benchout.schema.json')
-rw-r--r--benchtests/scripts/benchout.schema.json42
1 files changed, 42 insertions, 0 deletions
diff --git a/benchtests/scripts/benchout.schema.json b/benchtests/scripts/benchout.schema.json
new file mode 100644
index 0000000000..affb7c11f4
--- /dev/null
+++ b/benchtests/scripts/benchout.schema.json
@@ -0,0 +1,42 @@
+{
+  "title": "benchmark",
+  "type": "object",
+  "properties": {
+    "timing_type": {
+      "type": "string"
+    },
+    "functions": {
+      "title": "Associative array of functions",
+      "type": "object",
+      "patternProperties": {
+        "^[_a-zA-Z][_a-zA-Z0-9]+$": {
+          "title": "Function names",
+          "type": "object",
+          "patternProperties": {
+            "^[_a-zA-Z0-9]*$": {
+              "title": "Function variants",
+              "type": "object",
+              "properties": {
+                "duration": {"type": "number"},
+                "iterations": {"type": "number"},
+                "max": {"type": "number"},
+                "min": {"type": "number"},
+                "mean": {"type": "number"},
+                "timings": {
+                  "type": "array",
+                  "items": {"type": "number"}
+                }
+              },
+              "required": ["duration", "iterations", "max", "min", "mean"],
+              "additionalProperties": false
+            }
+          },
+          "additionalProperties": false
+        }
+      },
+      "minProperties": 1
+    }
+  },
+  "required": ["timing_type", "functions"],
+  "additionalProperties": false
+}