Skip to content

Commit

Permalink
UI refreshes image every second with ?reload.
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorDoyle committed Jun 22, 2017
1 parent 9f907dc commit 05cbed4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
18 changes: 17 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>cpuset-visualizer</title>
<script type="text/javascript">
function reloadPage() {
console.info("reloading");
location.reload(true); // true - bypass cache
}

params = new URLSearchParams(window.location.search);

if (params.has("reload")) {
document.addEventListener("DOMContentLoaded", function(event) {
// Call reloadPage in 1 seconds.
setInterval(reloadPage, 1000);
});
}
</script>
</head>
<body>
<img src="./topology.svg"></img>
<img id="topology-image" src="./topology.svg" />
</body>
</html>
3 changes: 2 additions & 1 deletion server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ gen_topology_forever () {
echo "Generating topology as seen from this process every second"
while true;
do
lstopo --pid $$ --no-io --of svg > topology.svg
lstopo --pid $$ --no-io --of svg > topology.svg.new
mv topology.svg.new topology.svg
/bin/sleep 1
done;
}
Expand Down

0 comments on commit 05cbed4

Please sign in to comment.