Unveiling `guprecords.raku`: Global Uptime Records with Raku
Published at 2023-04-30T13:10:26+03:00, last updated Fri 20 Feb 21:18:46 EET 2026
Table of Contents
- ⇢ Unveiling `guprecords.raku`: Global Uptime Records with Raku
- ⇢ ⇢ Introduction
- ⇢ ⇢ How Guprecords works
- ⇢ ⇢ Example
- ⇢ ⇢ Conclusion
Introduction
For fun, I am tracking the uptime of various personal machines (servers, laptops, workstations...). I have been doing this for over ten years now, so I have a lot of statistics collected.
As a result of this, I am introducing `guprecords.raku`, a handy Raku script that helps me combine uptime statistics from multiple servers into one comprehensive report. In this blog post, I'll explore what Guprecords is and some examples of its application. I will also add some notes on Raku.
Guprecords, or global uptime records, is a Raku script designed to generate a consolidated uptime report from multiple hosts:
**Updated Fri 20 Feb 2026**: Guprecords has also been rewritten in Go as `goprecords` for improved performance and easier distribution. The Go version is fully compatible and supports the same features (categories, metrics, and output formats). The Go version also comes with a server mode and API. Both implementations are maintained and available.
A previous version of Guprecords was actually written in Perl, the older and more established language from which Raku was developed. One of the primary motivations for rewriting Guprecords in Raku was to learn the language and explore its features. Raku is a more modern and powerful language compared to Perl, and working on a real-world project like Guprecords provided a practical and engaging way to learn the language.
Over the last years, I have been reading the following books and resources about Raku:
- Raku Guide (at raku.guide)
- Think Perl 6
- Raku Fundamentals
- Raku Recipes
And I have been following the Raku newsletter, and sometimes I have been lurking around in the IRC channels, too. Watching Raku coding challenges on YouTube was pretty fun, too. However, nothing beats actually using Raku to learn the language. After reading all of these resources, I may have a good idea about the features and paradigms, but I am by far not an expert.
How Guprecords works
Guprecords works in three stages:
- 1. Generating uptime statistics using `uptimed`: First, I need to install and run `uptimed` on each host to generate uptime statistics. This tool is available for most common Linux and *BSD distributions and macOS via Homebrew.
- 2. Collecting uptime records to a central location: The next step involves collecting the raw uptime statistics files generated by `uptimed` on each host. It's a good idea to store all record files in a central git repository. The records file contains information about the total uptime since boot, boot time, and the operating system and kernel version. Guprecords itself does not do the collection part, but have a look at the `README.md` in the git repository for some guidance.
- 3. Generating global uptime stats: Finally, run the `guprecords.raku` script with the appropriate flags to create a global uptime report. For example, I can use the following command:
This command will generate a comprehensive uptime report from the collected statistics, making it easy to review and enjoy the data.
Guprecords supports the following features:
- Supports multiple categories: Host, Kernel, KernelMajor, and KernelName
- Supports multiple metrics: Boots, Uptime, Score, Downtime, and Lifespan
- Output formats available: Plaintext, Markdown, and Gemtext
- Provides top entries based on the specified limit
Example
You have already seen an example at the very top of this post, where the hosts were grouped by their total lifespans (uptime+downtime). Here's an example of what the global uptime report (grouped by total host uptimes) might look like:
This table ranks the top 20 hosts based on their total uptime, with the host having the highest uptime at the top. The hosts marked with `*` are still active, means stats were collected within the last couple of months.
My up to date stats can be seen here:
Just recently, I decommissioned `vulcan` (the number one stop from above), which used to be my CentOS 7 (initially CentOS 6) VM hosting my personal NextCloud and Wallabag (which I modernised just recently with a brand new shiny Rocky Linux 9 VM). This was the last `uptimed` output before shutting it down (it always makes me feel sentimental decommissioning one of my machines `:'-(`):
Conclusion
Guprecords is a small, yet powerful tool for analyzing uptime statistics. While developing Guprecords, I have come to truly appreciate and love Raku's expressiveness. The language is designed to be both powerful and flexible, allowing developers to express their intentions and logic more clearly and concisely.
Raku's expressive syntax, support for multiple programming paradigms, and unique features, such as grammars and lazy evaluation, make it a joy to work with.
Working on Guprecords in Raku has been an enjoyable experience, and I've found that Raku's expressiveness has significantly contributed to the overall quality and effectiveness of the script. The language's ability to elegantly express complex logic and data manipulation tasks makes it an excellent choice for developing tools like these, where expressiveness and productiveness are of the utmost importance.
So far, I have only scratched the surface of what Raku can do. I hope to find more time to become a regular Rakoon (a Raku Programmer). I have many Ideas for other small tools like Guprecords, but the challenge is finding the time. I'd love to explore Raku Grammars and also I would love to explore writing concurrent code in Raku (I also love Go (Golang), btw!). Ideas for future Raku personal projects include:
- A log file analyzer, for generating anonymized `foo.zone` visitor stats for both, the Web and Gemini.
- A social media sharing scheduler a la `buffer.com`. I am using Buffer at the moment to share posts on Mastadon, Twitter, Telegram and LinkedIn, but it is proprietary and also it's not really reliable.
- Rewrite the static photo album generator of `irregular.ninja` in Raku (from Bash).
E-Mail your comments to hi@foo.zone :-)
Other related posts are:
2025-11-02 Perl New Features and Foostats
2022-06-15 Sweating the small stuff - Tiny projects of mine
2022-05-27 Perl is still a great choice