Actors/Packages/CLI/API reference
@sigx/actors-cli · Preview

API reference#

Exports of @sigx/actors-cli v0.1.0.

The plugin#

The default export is a definePlugin({ name: 'actors', detect, commands, tui }). You do not import it — @sigx/cli discovers it through the sigx-cli manifest field:

JSON
"sigx-cli": { "plugin": "./dist/plugin.js", "requires": ">=0.9.0" }

detect(cwd: string): boolean is also exported; it is what decides whether the actors commands appear, by checking that the project depends on @sigx/actors.

@sigx/actors-cli/source#

The renderer-free data layer, for anyone building another front end over the same data.

ExportRole
httpSource(options)poll a running host's ops endpoint
embeddedSource(options)load an app module in-process
hostViewFromReport(report)a HostReportHostView
rateBetween(a, b)derive a rate from two samples
RateTrackerstateful rate tracking
* as formatthe display formatters the dashboard uses

Types: MonitorSource, MonitorSnapshot, HostView, ClusterView, HttpSourceOptions, EmbeddedSourceOptions, Series, Rate, RateSample. Errors: OpsRequestError, EmbeddedSourceError.

The counter-reset rule#

A counter going backwards is a reset, and must yield a gap rather than a rate.

metrics().reset() exists, and a host restart re-zeros everything. Computing (now - then) / dt across that boundary produces a large negative or wildly wrong rate, which on a graph looks like an incident that did not happen.

rateBetween returns nothing for a decreasing pair. If you build your own, do the same.

Next steps#