Skip to content

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:

text
jaro addr | jaro stat emails

Will 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:

text
jaro search date:1w.. | jaro stat folders

Will 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:

text
jaro search folder:org.dyne.dng | jaro extract stdin from | jaro stat names

Will 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:

text
to    dng@lists.dyne       save         org.dyne.dng

Please 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:

text
jaro replay list

To replay the last search command and pipe it into headers to have a better view of it:

text
jaro replay search | jaro headers

For 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

text
jaro search to:nettime-l | jaro extract stdin from | sort | uniq

Depending 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:

text
jaro replay extract | jaro stat names

This 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.

commandeffect
stats emailreads addresses from stdin, prints out stats on frequency of emails found
stats namesreads addresses from stdin, prints out stats on frequency of names found
stats foldersreads 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.