Closed sam-falvo closed 8 years ago
Looks great. Is there any particular reason you're using plain-text? All the other lit endpoints return JSON.
Ease of getting something working. I'll send a second patch that makes it emit JSON. Is there a recommended JSON serialization library I should look into? Or is hard-wired JSON sufficient?
There is no JSON in lua, but luvit comes with one.
local jsonEncode = require('json').encode
local json = jsonEncode(somevalue)
Also note that if a route returns a table, it will get auto-converted into JSON.
Thanks @squeek502, I forgot about that.
Thanks; I'll make that change in a few minutes. Stand by!
Done!
+1
Now with more asynchronous flavor and wholesome concurrency!
Should probably add self documenting entry in the TOC result at the /
route.
Since this is already closed I just tweaked it myself https://github.com/luvit/lit/commit/b07a7f02480ec824dda5a9e3f0c6fd0840685766
To access, hit the /metrics endpoint of the Lit server. This will produce a plain text, machine-readable result informing the user of the total memory consumed by the Lit server, as well as the total number of file descriptors used by Lit at the time the metrics were requested.