Mail Latency Action
The mail-latency action reads messages from a Maildir, computes the delivery latency of each one from its Received headers, and writes the result as a CSV file.
It is an external action, published in mozership/probe-mail-latency ; it was built into Probe up to v1.21.0. Probe downloads it the first time a workflow uses it, and runs the executable whose SHA-256 the action.yml at the pinned commit names. It needs Probe v1.21.0 or later. The notes of each release start with the uses line to copy.
The action connects to no host, so its action.yml declares guard: [allow-host], and Probe runs it under --allow-host without --allow-action. It writes its CSV into output_dir, so it declares no read-only: under --read-only, a step that uses it is refused unless --allow-action names it. See Guard.
Basic Syntax
The action reads the messages in a directory and writes the measurements as a CSV file.
- name: Measure delivery latency
uses: github.com/mozership/probe-mail-latency@2340503ddb7081e1a7e4cc7e4391ac6e5937574d # v0.1.0
with:
mail_dir: "/var/mail/probe/new"
output_dir: "./reports"
test: res.status == 0Parameters
Both directories are required: one to read from, one to write to.
| Parameter | Type | Required | Description |
|---|---|---|---|
mail_dir | String | Yes | Directory holding the messages to measure |
output_dir | String | Yes | Directory the CSV file is written to |
mail_dir is read recursively, subdirectories included. A file is measured when it starts with a Return-Path: or Delivered-To: header, which is how a delivered message usually begins. Other files are left alone. Only the headers are read, up to the first empty line, and a header may be folded over several lines or not. The action fails, and writes no CSV, when a measured message has no Date header or no Received header.
Each message becomes one row of the CSV, with these columns:
Sent Time Offset (sec)andReceived Time Offset (sec): when the message was sent and received, counted from the earliestDatein the directorySent Time: theDateheaderLast Received TimeandFirst Received Time: the topmost and the bottomReceivedheaderEnd-to-End Latency (sec): fromDateto the topmostReceivedRelay Latency (sec): from the bottomReceivedto the topmost oneReturn PathandFile Path: the envelope sender and the file name
Times are written in the local time zone of the machine running probe, as 2006-01-02 15:04:05.
Response Object
The result points at the file that was written.
| Field | Type | Description |
|---|---|---|
res.output_file | String | Path of the written CSV file, named mail-latency.<timestamp>.csv. A run in the same second as an earlier one writes mail-latency.<timestamp>-2.csv and so on instead of overwriting it |
res.status | Integer | 0 on success |
rt.duration | String | Time spent measuring, such as "1.2ms" |
rt.sec | Float | Time spent measuring in seconds |
status | Integer | 0 on success |