Skip to content

Commit

Permalink
Merge pull request #2 from jelu/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
jelu authored May 22, 2024
2 parents 2176ee8 + b2f78bc commit e5cee3a
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 58 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
78 changes: 37 additions & 41 deletions dns-metrics.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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"
}
},
Expand All @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions examples/header.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
10 changes: 5 additions & 5 deletions examples/stat_periodic.json → examples/stats_periodic.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
11 changes: 5 additions & 6 deletions examples/stat_summary.json → examples/stats_summary.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 6 additions & 0 deletions examples/test.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e5cee3a

Please sign in to comment.