Skip to content

Instantly share code, notes, and snippets.

@ikari-pl
Created October 26, 2023 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikari-pl/71cf8ae4206e8a3eb54cff78416ec8b0 to your computer and use it in GitHub Desktop.
Save ikari-pl/71cf8ae4206e8a3eb54cff78416ec8b0 to your computer and use it in GitHub Desktop.
Temporal activity heartbeat tracker
// ==UserScript==
// @name Shows history of heartbeats on temporal.io
// @namespace Violentmonkey Scripts
// @match https://cloud.temporal.io/namespaces/filing-factory-prod.laf1h/workflows/*
// @grant none
// @version 1.0
// @author ikari
// @description 10/24/2023, 9:57:35 PM
// ==/UserScript==
let tt="";
let tm = setInterval(function() {
let nt = document.querySelector('div.pending-activity-failure-details > div > div > div > div > div.cm-scroller > div.cm-content').innerText;
if (tt != nt) {
tt = nt; console.log(nt);
let logWin = document.querySelector('#logWin');
if (!logWin) {
logWin = document.createElement('div');
logWin.id = 'logWin';
logWin.style = `position: absolute;
right: 10px;
bottom: 10px;
background: rgba(0,0,0,0.7);
border: 2px solid white;
border-radius: 10px;
color: white;
font-family: monospace;
white-space: pre;
max-height: 20em;
overflow-y: scroll;`;
document.body.appendChild(logWin);
}
let line = document.createElement('div');
line.innerText = (new Date()) + nt;
logWin.appendChild(line);
}
}, 1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment