All answers you got here are good, but it depends how simple do you want it.
Your current solution doesn’t meet one of your criteria already. The code that produces the data cannot run for an extended period of time if it keeps all data in memory and only writes it at shutdown (or USR1).
It would be trivial to modify the program to write on every new data point collected. Then you just tail that file from the Webserver process.
You could use more performant solutions, like explicit pipes, Unix sockets, websockets, or even shared memory, but keeping it simple is often the best way. This makes your data collection better (no memory “leaks”) without really adding code, you could in fact remove code (USR1 handling).
If 11 people are sitting at a table with a known Nazi, chatting, enjoying themselves and having a great time, you have a table with 12 nazis.