debug::heartbeat(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

debug::heartbeat β€” debug narrative β€” heartbeat 🫢

okay so bestie, this is the little guy that goes thump thump so you can literally watch your event loop breathe. yes queen, that's the whole job.


✨ SYNOPSIS ✨

package require Tcl 8.5 9

package require debug::heartbeat ?1.0.2?

package require debug ?1?

debug heartbeat ?delta?

🌸 DESCRIPTION 🌸

πŸ’… API

  • debug heartbeat ?delta? β€” the one and only move. this turns the heartbeat on, or off, and the heartbeat is the thing you use to keep an eye on the event loop of an event-based Tcl application. like a little monitor on your wrist but for your event loop, periodt.

it reserves the debug tag heartbeat all for itself β€” that tag is taken, no sharing β€” and it writes a message every delta milliseconds. every. single. delta ms. πŸ’–

a delta-value <= 0 disables the heartbeat. so if you want it to stop, you send it zero or a negative number and it's gone, no cap.

the message the heartbeat produces contains a sequence counter plus the time in milliseconds since the last beat. which is iconic, because it gives you insight into timing variations and into deviations from the nominal delta. so if your beats start drifting you see it. the way that's actually useful? obsessed. 🌈

ngl, the timing info is the whole point β€” that's how you spot the event loop getting sluggish instead of just vibing in the dark. πŸ”₯

😭 BUGS, IDEAS, FEEDBACK 😭

this document, and the package it describes, will undoubtedly contain bugs and other problems. like, obviously. it's software, bestie. πŸ’€

please report such in the category debug of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist](http://core.tcl.tk/tcllib/reportlist). please also report any ideas for enhancements you may have for either the package and/or the documentation. we want the glow-up ideas too, fr fr.

when proposing code changes, please provide unified diffs, i.e the output of diff -u.

note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. yes, that specific button. left-most. slay. πŸ‘‘


πŸŽ€ KEYWORDS πŸŽ€

debug, heartbeat, log, narrative, trace


πŸ¦‹ CATEGORY πŸ¦‹

debugging, tracing, and logging


Copyright (c) 200?, Colin McCormack, Wub Server Utilities
Copyright (c) 2012, Andreas Kupries <andreas_kupries@users.sourceforge.net>

and that's the whole page, bestie πŸ’œ this lil narrative dropped as part of tcllib 1.0.2 β€” go make your event loop spill the tea πŸ“βœ¨

πŸ“¦ where this page comes from