Uptime Table

We're collecting availability stats from recorded exit status provided by a Datalog plugin curl extension. Here we report these as uptime percentages in tabular form.

We host the pure javascript application as an html asset.

ward.asia.wiki.org/assets/plugins/datalog/uptime.html

Parameters in a query string describe where to find logs and how to format them as a table.

protocol=http

site=ward.asia.wiki.org

slug=ping-wiki-servers

The Datalog plugin will maintain a rolling collection of files in an Assets folder identified by this site and slug.

chunk=month

keep=2

We will expect month size files and will fetch two so that we roll over chunk boundaries smoothly.

report=hour

show=24

We assemble chunks into a continuous stream and then separate that into wall clock aligned reporting periods working backwards in milliseconds from time now.

Try these parameters now. uptime

Development workflow: View source, save as, edit, test with file:, upload as new asset.

# Use

There is a quirk in how we time limit both the curl we use as a probe and the call Datalog makes on it. If curl gives up before Datalog, then we record an exit status. But if Datalog gives up first, then we record an empty object, {}.

This led us to show a slow site as blank, and a missing site as 0.0. Not the ideal coding. Our fix is to set timeouts to 3000 and 3100 respectively, down from our problematic 5000 and 2000.

A better solution would be to replace the curl endpoint with a direct ping from the sampling logic. See Ping Service

The show logic sometimes leaves a widowed interval as the first row. I didn't think that possible.