Module stats

Source
Expand description

Links statistics

Statistics can be collected by the redirector server after every redirect and have a numeric value indicating the number of requests performed by someone/something that matches a particular Statistic. The value of the statistic is simply incremented for every matching request.

Statistics are represented as a key-value pair, where the key is this struct and the value is a number that gets incremented each time a statistic is collected. The actual internal representation depends on the store backend, but could for example be a string like id-or-vanity:statistic-type:statistic-time:statistic-data, i.e. example:user_agent_platform:2022-10-02T14:30:00Z:Windows. It is also important to note that statistics are collected individually, not in a combined per-request object - they are simple counters, incremented per request. This helps in preserving the users’ privacy, because multiple pieces of data can not reliably be correlated with each other, e.g. the server may know that there were 22 requests from Firefox users and 19 requests using HTTP/2, but it can not know if any of these describe the same request.

Not all statistics are necessarily always collected. A store backend may not support statistics, statistics may not be enabled in the configuration, there may not be enough data to collect a specific statistic, or statistic collection may fail. None of these situations are considered critical errors; statistics are not an integral part of links.

Modules§

internals 🔒
Types that make up a links Statistic
misc 🔒
Miscellaneous statistics-related types

Structs§

ExtraStatisticInfo
Extra statistics-related information passed to the links HTTP redirector for collection
Statistic
A links statistic
StatisticCategories
Which categories of statistics are to be collected
StatisticData
The data for a statistic
StatisticDescription
A description of one or more Statistics, where some fields may be omitted so that they act as a wildcard
StatisticTime
The timestamp for a statistic
StatisticValue
The value of a links statistic
UnknownHttpVersionError
The error returned when attempting to convert an HttpVersion::Unknown to another type that can’t represent that value

Enums§

HttpVersion
An HTTP protocol version
IdOrVanity
A links ID or vanity path
StatisticType
The type of a links statistic