assay trend <file or directory…>
Shows how the snapshots that assay gate --snapshot and assay metrics --snapshot wrote moved: one point for each commit, the series of what the points hold, and the events between them. It judges nothing.
assay trend <file or directory…> [--reporter console[:<file>]|html[:<file>]]… [--color auto|always|never]It reads the snapshots alone, so it needs no project, no configuration and no pub get, and runs in any directory.
| You name | It reads |
|---|---|
| a file | its records: one, or one a line where its name ends with .jsonl |
| a directory | the files directly in it whose names end with .json or .jsonl, in the order of their names; not the directories below it |
A file named twice, by itself or in a directory, is read once. See Snapshots and trends for what a record holds and how each series and event is counted, and Keeping the snapshots in CI for keeping them from one run to the next.
Options
Section titled “Options”| Option | Effect |
|---|---|
--reporter console[:<file>] |
The console form, to standard output (the default) or to a file in the plain form. Repeatable. |
--reporter html[:<file>] |
The page in HTML, to a file or to standard output, which takes one page at most. |
--color auto|always|never |
The form on standard output, as for every command. |
A report file is named by a path absolute or relative to the directory the command runs in; the directories above it are created. Two reporters given the same file are a usage error.
Examples
Section titled “Examples”assay trend assay-snapshots/ # every snapshot directly in that directoryassay trend all.jsonl assay-snapshots/ # files and directories togetherassay trend assay-snapshots/ --color never # the plain form on a terminalassay trend assay-snapshots/ --reporter console:build/trend.txtassay trend assay-snapshots/ --reporter console --reporter html:build/assay-trend.htmlOutput
Section titled “Output”- Console. Titled boxes of one width: a head box with the package, the branches, the points, the snapshots and what was passed by and skipped; a box
Passed bythat says why, where records were passed by; a box of the last 20 points, with a row that counts the earlier ones; a box of the first and the last value of each series that both ends hold, with how it moved; and a box of every event, with the day and the commit of its point. One point has nothing to compare, and a line below the boxes says so. See The console form for an example. - HTML. One page that needs nothing beside itself: its style sheet is in it, its charts are SVG drawn in it, it runs no script and names no outside address. Its policy (
default-src 'none'; style-src '<hash of its style sheet>'; base-uri 'none'; form-action 'none') lets it load nothing. It holds the head, the latest value of each series, a chart of each series but the gate’s verdict, the events and every point as a table. It follows the system’s light or dark setting and fits a phone-width window. 1,000 points make a page of about 560 KB. See The page in HTML.
On a terminal the boxes are as wide as the terminal, kept between 60 and 120 columns, the marks are Unicode and the verdicts coloured. In a file and with --color never the text is ASCII without escape codes, and in a file or a pipe it is 100 columns wide. Any text a record holds, such as a branch name, is shown with every character a terminal would act on written out, and is escaped in the page.
Records that are passed by
Section titled “Records that are passed by”A store of snapshots that CI keeps can hold records this version cannot read. These are passed by and counted, and never end the trend:
- a record of a newer version (
assay.snapshot/2), counted with its version; - a record that lacks a field, holds one in another form, has a value this version does not know (a command, a verdict, a failure reason, a source, a tier, a condition’s target, bound or status), or a time without its zone (
Zor an offset); - a line of a
.jsonlfile that is no record, while its other lines are read; - a file named that holds no snapshot, and a file that cannot be read;
- a file in a directory that holds no snapshot record at all (not JSON, no object, another schema such as
assay.result/3), counted in the head box asSkipped 1 file; - the snapshots of every package but that of the latest snapshot. A trend is of one package, and a package whose pubspec changed its name is another package, so after a rename the trend follows the new name.
The head box counts them (Passed by 3 records). A box Passed by below it counts the records of other packages and of newer versions, and names each record this version could not read, by its file, its line in a .jsonl file and the field (the first ten, and how many more). The HTML page says the same in its head.
Exit codes
Section titled “Exit codes”| Code | When |
|---|---|
| 0 | It read one snapshot at least. |
| 2 | A usage error: no path; a path that names nothing, or names what is no regular file and no directory, such as a named pipe; a directory it cannot list; or no snapshot left to show. Nothing is written to standard output. |
| 3 | A report file could not be written. Standard error names it and the cause, and the other reports are still written. |
A named pipe inside a directory is passed by and never opened. Where nothing is left to show, the message gives the reason. When one record or one named file was passed by and nothing else, you get its own message:
The file `result.json` holds no snapshot that this version of assay reads: it names no schema.Otherwise the message says that no snapshot was found, and what was passed by.