{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://heartcortex.ai/schemas/1.0/metric.schema.json",
  "title": "metric",
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "x-heart-privacy": "public"
    },
    "kind": {
      "enum": [
        "gauge",
        "counter",
        "histogram"
      ],
      "x-heart-privacy": "public",
      "description": "gauge: a value that goes up and down. counter: a total that only goes up, reset only on restart. histogram: each point is a summary of a distribution."
    },
    "unit": {
      "type": "string",
      "x-heart-privacy": "public",
      "description": "UCUM unit code, such as Cel or L/min."
    },
    "points": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "time",
          "value"
        ],
        "properties": {
          "time": {
            "$ref": "common.schema.json#/$defs/timestamp"
          },
          "value": {
            "type": "number"
          }
        }
      },
      "x-heart-privacy": "internal"
    },
    "ext": {
      "$ref": "common.schema.json#/$defs/ext",
      "x-heart-privacy": "private"
    }
  }
}
