How do you know the number is still live?
  • NestJS
  • React
  • Monitoring
  • SSE

How do you know the number is still live?

56
Today I finished the server monitoring panel. It has around ten screens: resources, projects, containers, services, security, traffic, live logs and deployment. The panel takes a new measurement every two seconds. And here an unexpected problem appeared: the numbers do update, but because they change quietly, a person looking at the screen cannot tell whether the data is fresh or the page has frozen. Especially when the server is idle, all the numbers stay the same and the screen looks dead. For this I added a separate indicator. It counts, every second, how many seconds have passed since the last measurement. While the stream is alive the number stays small. If the stream breaks, the number starts growing and immediately catches the eye. Another fix involved timers. When reading the list of the system's scheduled jobs, some columns ran into each other, because they contain spaces inside — things like "2 minutes ago" or a long date. Splitting by columns was unreliable. The solution: I fetched the list with a different command and asked for each timer's values separately. There the fields are named and there is no room for confusion. The panel's core principle is that it only reads. It changes nothing. That way, even if the panel is broken into, it cannot be used to affect the server.