{"size": 786, "ext": "js", "max_stars_repo_path": "app.js", "max_stars_repo_name": "MammatusPHP/healthz-vhost", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app.js", "max_issues_repo_name": "MammatusPHP/healthz-vhost", "max_issues_repo_issues_event_min_datetime": "2021-04-20T22:50:28.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T02:22:23.000Z", "max_forks_repo_path": "etc/vhosts/healthz/app.js", "max_forks_repo_name": "MammatusPHP/http-server", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 52, "max_forks_count": null, "avg_line_length": 32.75, "max_line_length": 116, "alphanum_fraction": 0.6641221374}
import {Client} from "thruway.js";

const wamp = new Client(
    'ws://' + location.host + '/',
    'healthz'
);

wamp.topic('healthz').map(args => args.args[0]).subscribe((broadcast => {
    document.getElementById('websocket_subscription').innerHTML = broadcast.status;
}));

setInterval(() => fetch('http://' + location.host + '/healthz').then(response => response.json()).then(response => {
    document.getElementById('xhr').innerHTML = response.result;
}), 1338);

setInterval(() => wamp.call('healthz').toPromise().then(args => args.args[0]).then(response => {
    document.getElementById('websocket_rpc').innerHTML = response.result;
}), 1337);

setInterval(() => wamp.publish('client_healthz', {
    message: 'Healthy client reporting in!',
    href: location.href,
}), 1336);
