Compute and visualize statistics
Adapted from the Jaromail manual source. Copyleft © 2010–2023 Denis Roio. GNU Free Documentation License 1.3 or later; full permission notice.
Optional integrations
Some features in this chapter are legacy or platform-specific. See optional integrations for their maintenance status.
The stats command is useful to quickly visualize statistics regarding folder usage as well the frequency of emails found in a stream from stdin. Such streams can be produced by the search and extract commands for instance and passed to stats in order to have a more graphical (yet ASCII based) visualization of results.
For example lets visualize the frequency of email domain hosts in our whitelist:
jaro addr | jaro stat emailsWill print out bars and domains in descending order, highlighting the most frequent email domain in our contacts, which turns out to be very often gmail.com, unfortunately for our own privacy.
To visualize the frequency of traffic across our filtered folders in the past month:
jaro search date:1w.. | jaro stat foldersWill show quantities of mails filed to folders during the past week, quickly highlighting the mailinglists that have seen more recent activity.
To see who is most active in a mailinglist which is filtered to a folder:
jaro search folder:org.dyne.dng | jaro extract stdin from | jaro stat namesWill give an overview on who is the most prolific writer in the org.dyne.dng mailinglist, filed into the folder by a rule in Filters.txt like:
to dng@lists.dyne save org.dyne.dngPlease note the extract command is there to extract email addresses and names found in the From: field of all search hits, the command is explained better in the next chapter: Addressbook*.
Replay results of expensive operations
Working on the commandline can have some disadvantages. One of them is that if one runs a long operation to see its result and forgets to save it also on a file (i.e. using tee) the operation needs to be re-run and saved.
Jaro Mail helps the user to replay the last output print by saving it everytime in its own cache. Replay can also save per-command outputs so that long pipe chains can be repeated selectively by naming the command. Only some commands have the replay capability, to have a list of available replays on your system do, based on your last run commands:
jaro replay listTo replay the last search command and pipe it into headers to have a better view of it:
jaro replay search | jaro headersFor instance imagine giving the command that searches for all mails sent to nettime-l and extracts all addresses in the From: including duplicates, then sorts them and eliminates duplicates
jaro search to:nettime-l | jaro extract stdin from | sort | uniqDepending from the size of your nettime archives, this operation may take some time and one may not want to repeat it in order to compute some stats on the extract result. So one can go on and send the old output to a new command:
jaro replay extract | jaro stat namesThis will print out statistics about the most prolific write to the nettime list according to your archives.
Statistics in brief
All stats commands takes lists of addresses or email messages from stdin.
| command | effect |
|---|---|
| stats email | reads addresses from stdin, prints out stats on frequency of emails found |
| stats names | reads addresses from stdin, prints out stats on frequency of names found |
| stats folders | reads paths to messages from stdin, prints out stats on frequency of folders |
So in case of stats email or stats names any result of search must be first filtered by extract in order to provide addresses to stats, else errors will occur. To limit the stats to the From: field use the extract stdin from also shown in examples, any other refinement can be done also in the domain of the search commands.