Day 22 – Santa Claus is Rakuing Along

Part 4 – The Santa Claus Reports

Prologue

A Christmas ditty sung to the tune of Santa Claus is Coming to Town:

 He’s making a list,
 He’s checking it closely,
 He’s gonna find out who’s Rakuing mostly,
 Santa Claus is Rakuing along.

Santa Claus Operations Update 2021

Part 1 of this article reported on the new journaling process for Santa’s employees and how they keep their individual work logs. Part 2 was a side step to show how to better manage Santa’s code by using the new Zef module repository. Part 3 was another side step because Santa was running out of time.

This article, written by yours truly, junior Elf Rodney, will attempt to showcase the use of Raku’s built-in date, time, and sorting functions along with the ease of class construction to handle the new journals in the aggregate to automate many of the reports that used to take goodly amounts of time. They can now be prepared quickly and thus free resources to research more deeply-observed problem areas.

The Reporting System

The journals are frequently read and manipulated by system-wide programs (most found in the Raku module SantaClaus::Utils) run by root. Individual journals are periodically shortened by extracting older entries which are then concatenated onto hidden .journal.YYYY.MM files (owned by root but readable by all) in the user’s home directory.

The data in the journal files are converted to class instances which are deployed for the moment in two global Raku hashes keyed by task-id and user-id, respectively. (When the new persistent types in Raku are ready, they will be a natural fit to form a large on-disk database).

Before designing classes to use with the journals let’s take a quick look at how we want the data to be accessed and used.

First, the raw data give us, for each user and his assigned task (which may be a sub-task):

  • start time on the task
  • process time
    • one or more reports between start and finish
  • end time of the task
  • notes for each entry

Second, the raw data give us, for each task and sub-task

  • earliest start time
  • latest end time
  • total employee time expended on the task
  • list of employees working on each task and time each expends on the task

It seems that the data we have so far collected don’t yield the task/sub-task relations, but that is solved with a task-id system designed with that in mind. As a start, the task-id is a two-field number with the first field being the task number and the second field being the sub-task number. Supervisors will normally use the task number and their subordinates the sub-task number.

For example, a task number might be 103458 with sub-tasks of 200 and 202. The three numbers entered by the different employees working them would enter:

  • Supervisor: 103458-000
  • Employee A: 103458-200
  • Employee B: 103458-202

The final system could be as detailed as desired, but the two-level task-id is sufficient for now.

[Sorry, this article will  be finished later–I am needed for last minute jobs in the factory!]

Summary

Santa now has a personnel and task reporting system that automatically produces continuously updated reports on current tasks and the personnel resources used for them. Raku’s built-in date, time, and sorting functions help ease the work of the IT department in their job of programming and maintaining the system.

Santa’s Epilogue

Don’t forget the “reason for the season:” ✝

As I always end these jottings, in the words of Charles Dickens’ Tiny Tim, “may God bless Us , Every one! [1]”

Footnotes

  1. A Christmas Carol, a short story by Charles Dickens (1812-1870), a well-known and popular Victorian author whose many works include The Pickwick Papers, Oliver Twist, David Copperfield, Bleak House, Great Expectations, and A Tale of Two Cities.

3 thoughts on “Day 22 – Santa Claus is Rakuing Along

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.