← All procedures

algebra.probeTrain

This function gives the times of a train of probes, exactly, in seconds. The first probe is at `first`, and each next probe is one `interval` later, `count` probes in all. A first time without an end gives no probe. An interval without an end gives only the first probe. Keepalive at its defaults sends its probes at 7200 s, 7275 s, and so on to 7800 s.

CLI
Package
@procedures/algebra · README
Path
["algebra","probeTrain"]
CLI
mark algebra probeTrain --first <object | object> --interval <object | object> --count <number>
As data
{"$proc":["algebra","probeTrain"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/algebra/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["algebra","probeTrain"], { first: "<first>", interval: "<interval>", count: 1 });
console.log(JSON.stringify(result));

From the command line

$ mark algebra probeTrain --first <object | object> --interval <object | object> --count <number>

As data, in a program

{
  "$proc": ["algebra", "probeTrain"],
  "input": { "first": "<first>", "interval": "<interval>", "count": 1 }
}

Input

FieldTypeRequiredDefaultDescription
firstobject | objectyes
intervalobject | objectyes
countnumberyes

Output

The schema does not list fields (object[]).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "first": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "unit": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "unit"
            ],
            "additionalProperties": {}
          },
          {
            "type": "object",
            "properties": {
              "value": {
                "type": "string",
                "const": "infinite"
              },
              "unit": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "unit"
            ],
            "additionalProperties": {}
          }
        ]
      },
      "interval": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "unit": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "unit"
            ],
            "additionalProperties": {}
          },
          {
            "type": "object",
            "properties": {
              "value": {
                "type": "string",
                "const": "infinite"
              },
              "unit": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "unit"
            ],
            "additionalProperties": {}
          }
        ]
      },
      "count": {
        "type": "number"
      }
    },
    "required": [
      "first",
      "interval",
      "count"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "array",
    "items": {
      "type": "object",
      "properties": {
        "value": {
          "type": "number"
        },
        "unit": {
          "type": "string"
        }
      },
      "required": [
        "value",
        "unit"
      ],
      "additionalProperties": {}
    }
  }
}