1:- module(proc_http_handlers, []). 2:- use_module(library(http/http_dispatch)). 3:- use_module(library(http/http_json)). 4:- use_module(loadavg). 5 6:- http_handler(root(proc/loadavg), proc_loadavg, []). 7 8proc_loadavg(_Request) :- 9 loadavg(A, B, C, D/E, F), 10 reply_json_dict(_{avg1:A, 11 avg5:B, 12 avg15:C, 13 runnables:D, 14 processes:E, 15 last_pid:F 16 })