Stats command

syside stats reports the number of files, lines, and elements in a model. Share the output in a performance question or benchmark report to describe your model’s size without sharing the model itself.

If the model is already open in the Syside VS Code Extension, use the model statistics dashboard to view the same counts and copy them as JSON. The CLI loads a separate copy of the model into memory. For very large models, running both at once can exhaust available memory. Use the CLI in CI or when working outside VS Code.

Basic usage

syside stats [paths...]

[paths...] accepts .sysml or .kerml files, directories, and glob patterns. Directories are searched recursively. If you omit paths, the command searches the working directory. It loads the model using the same configuration and Sysand environment as syside check.

The report goes to standard output, so you can redirect it to a file or pipe it to another command. Progress messages go to standard error.

Available options

Option

Description

-c, --config <FILE>

Path to a syside.toml configuration file. If omitted, use the same configuration discovery as syside check

--no-stdlib

Exclude the standard library from the counts and report

--json

Print the statistics as one JSON document instead of a table

What the report counts

The report groups counts by source: Project (your workspace), External (libraries you include), and Standard library (the SysML v2 standard library). It gives these counts for each group and for the model as a whole:

  • Files: the number of files the model loads.

  • Lines: the number of lines in those files, including comments and blank lines.

  • Elements: the number of model elements, grouped by type. Each element counts once, under its concrete type. The report also counts implied relationships generated by Syside and derived features.

Model errors do not stop the command, but the counts may be incomplete.

To measure analysis time per file, use syside check --stats --time. The stats command does not measure load time or memory use.

Exit codes

syside stats exits with the following codes:

Code

Meaning

0

Success, including a model that has errors

1

The model fails to load

2

Command-line usage error, such as an unknown option, no model files found, no project file, or no usable license

3

Configuration error: a syside.toml cannot be read or is malformed, or the --config file does not exist