diff --git a/README.md b/README.md index 4d1f177..20f7271 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ pip install check-jsonschema cd examples check-jsonschema --schemafile ../dns-metrics.schema.json header.json check-jsonschema --schemafile ../dns-metrics.schema.json event.json -check-jsonschema --schemafile ../dns-metrics.schema.json stat_periodic.json -check-jsonschema --schemafile ../dns-metrics.schema.json stat_summary.json -check-jsonschema --schemafile ../dns-metrics.schema.json stat_summary.json +check-jsonschema --schemafile ../dns-metrics.schema.json stats_periodic.json +check-jsonschema --schemafile ../dns-metrics.schema.json stats_summary.json ``` diff --git a/dns-metrics.schema.json b/dns-metrics.schema.json index eee2f6c..d7e7ee4 100644 --- a/dns-metrics.schema.json +++ b/dns-metrics.schema.json @@ -30,13 +30,13 @@ }, { "properties": { - "type": { "const": "stat_periodic" } + "type": { "const": "stats_periodic" } }, "$ref": "#/$defs/stats" }, { "properties": { - "type": { "const": "stat_sum" } + "type": { "const": "stats_sum" } }, "$ref": "#/$defs/stats" } @@ -50,50 +50,46 @@ "description": "The DNS metrics schema version in the format YYYYMMDD", "type": "integer" }, - "merged": { - "description": "", - "type": "boolean" - }, - "time_units_per_sec": { - "description": "", - "type": "integer" - }, "generator": { - "description": "", + "description": "The name of the software that generated this output", + "type": "string" + }, + "generator_version": { + "description": "The version of the software", "type": "string" }, "generator_params": { - "description": "", + "description": "Any parameters that was given to the software", "type": "array", "items": { "type": "string" } }, - "generator_version": { - "description": "", - "type": "string" + "time_units_per_sec": { + "description": "??TODO??", + "type": "integer" }, "stats_interval": { - "description": "", - "type": "integer" + "description": "The frequency of stats objects in this file, in fractional seconds", + "type": "number" }, "timeout": { - "description": "", - "type": "integer" + "description": "The network timeout used in the generator, in fractional seconds", + "type": "number" } }, - "required": [ "schema_version", "time_units_per_sec", "generator", "generator_version", "stats_interval" ] + "required": [ "schema_version", "generator", "generator_version", "stats_interval" ] }, "event": { "description": "A generic event object for tools to give context on the run", "type": "object", "properties": { "msg": { - "description": "", + "description": "The message about the event", "type": "string" }, "msg_type": { - "description": "", + "description": "The type of message", "type": "string" } }, @@ -104,65 +100,65 @@ "type": "object", "properties": { "since": { - "description": "", + "description": "The starting time for when the metrics of this object was gathered, in nanoseconds since 1970-01-01 00:00:00 UTC", "type": "integer" }, "until": { - "description": "", + "description": "The ending time for when the metrics of this object was gathered, in nanoseconds since 1970-01-01 00:00:00 UTC", "type": "integer" }, - "requests": { - "description": "", + "queries": { + "description": "The number of DNS queries", "type": "integer" }, - "answers": { - "description": "", + "responses": { + "description": "The number of DNS responses", "type": "integer" }, "timeouts": { - "description": "", + "description": "The number of DNS queries that timed out", "type": "integer" }, "interrupted": { - "description": "", + "description": "The number of DNS queries and/or responses that was interrupted", "type": "integer" }, "unexpected": { - "description": "", + "description": "The number of DNS queries and/or responses that was unexpected", "type": "integer" }, - "responses": { - "description": "", + "response_rcodes": { + "description": "The number of different RCODEs as an object with the RCODE as a property", "type": "object", "patternProperties": { "^\\W+$": { - "description": "", + "description": "The number of responses for a specific RCODE", "type": "integer" } } }, - "answer_latency": { - "description": "", + "response_latency": { + "description": "The latency metrics for responses to queries", "type": "object", "properties": { "avg": { - "description": "", + "description": "The average latency for a response to a query, in nanoseconds", "type": "integer" }, "min": { - "description": "", + "description": "The minimum latency for a response to a query, in nanoseconds", "type": "integer" }, "max": { - "description": "", + "description": "The maximum latency for a response to a query, in nanoseconds", "type": "integer" }, "stddev": { - "description": "", + "description": "The standard deviation for latency, in nanoseconds", "type": "integer" }, "buckets": { - "description": "", + "description": "??TODO??", "type": "array", "items": { "type": "array", diff --git a/examples/header.json b/examples/header.json index df54e3a..f1bfbd1 100644 --- a/examples/header.json +++ b/examples/header.json @@ -2,11 +2,10 @@ "runid": "1", "type": "header", "schema_version": 20221207, - "merged": true, - "time_units_per_sec": 1000000, "generator": "dnsperf", - "generator_params": ["-Q", "1000"], "generator_version": "2.10.0", + "generator_params": ["-Q", "1000"], + "time_units_per_sec": 1000000, "stats_interval": 1000000, "timeout": 1000000 } diff --git a/examples/stat_periodic.json b/examples/stats_periodic.json similarity index 79% rename from examples/stat_periodic.json rename to examples/stats_periodic.json index 1ad32f4..d0c1169 100644 --- a/examples/stat_periodic.json +++ b/examples/stats_periodic.json @@ -1,18 +1,18 @@ { "runid": "1", "threadid": "1", - "type": "stat_periodic", + "type": "stats_periodic", "since": 1675865567760972, "until": 1675865568761088, - "requests": 28659, - "answers": 28651, + "queries": 28659, + "responses": 28651, "timeouts": 0, "interrupted": 0, "unexpected": 0, - "responses": { + "response_rcodes": { "NOERROR": 28651 }, - "answer_latency": { + "response_latency": { "avg": 126, "min": 43, "max": 3967, diff --git a/examples/stat_summary.json b/examples/stats_summary.json similarity index 78% rename from examples/stat_summary.json rename to examples/stats_summary.json index 00a8cb4..3e0cb77 100644 --- a/examples/stat_summary.json +++ b/examples/stats_summary.json @@ -1,18 +1,17 @@ { "runid": "1", - "type": "stat_sum", + "type": "stats_sum", "since": 1675865567760972, "until": 1675865568761088, - "summary": true, - "requests": 28659, - "answers": 28651, + "queries": 28659, + "responses": 28651, "timeouts": 0, "interrupted": 0, "unexpected": 0, - "responses": { + "response_rcodes": { "NOERROR": 28651 }, - "answer_latency": { + "response_latency": { "avg": 126, "min": 43, "max": 3967, diff --git a/examples/test.sh b/examples/test.sh new file mode 100755 index 0000000..7258cf2 --- /dev/null +++ b/examples/test.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +check-jsonschema --schemafile ../dns-metrics.schema.json header.json +check-jsonschema --schemafile ../dns-metrics.schema.json event.json +check-jsonschema --schemafile ../dns-metrics.schema.json stats_periodic.json +check-jsonschema --schemafile ../dns-metrics.schema.json stats_summary.json