]> git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/test/page_status.lua
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / civetweb / test / page_status.lua
1 mg.write("HTTP/1.0 200 OK\r\n")
2
3 -- MIME type: https://www.ietf.org/rfc/rfc4627.txt, chapter 6
4 mg.write("Content-Type: application/json\r\n")
5
6 mg.write("\r\n")
7
8 num_threads = mg.get_option("num_threads")
9 num_threads = tonumber(num_threads)
10
11
12 function n(s)
13 if ((type(s) == "string") and (#s > 0)) then
14 return s
15 else
16 return "null"
17 end
18 end
19
20
21 mg.write("{\r\n\"system\" :\r\n")
22
23 mg.write(n(mg.get_info("system")))
24
25 mg.write(",\r\n\"summary\" :\r\n")
26 mg.write(n(mg.get_info("context")))
27 mg.write(",\r\n\"common\" :\r\n")
28 mg.write(n(mg.get_info("common")))
29 mg.write(",\r\n\"connections\" :\r\n[\r\n")
30
31 mg.write(n(mg.get_info("connection", 1)))
32
33 for i=2,num_threads do
34 mg.write(",\r\n")
35 mg.write(n(mg.get_info("connection", i)))
36 end
37 mg.write("]\r\n}\r\n")
38