piston icon indicating copy to clipboard operation
piston copied to clipboard

handle usage stats

Open vsecoder opened this issue 1 year ago • 0 comments

An attempt (like a working one) to add getting execution statistics via time. https://www.man7.org/linux/man-pages/man1/time.1.html

Example:

{
   "run":{
      "stdout":"hello world\n",
      "stderr":"",
      "code":0,
      "signal":null,
      "output":"hello world",
      "stats":{
         "elapsed_time":"0.20s",      <-- Elapsed real time
         "cpu_time":"0.00s / 0.01s",  <-- Total num of CPU-seconds that the process spent in user/kenrel mode
         "max_mem":"9636Kb"           <-- Max resident set size of the process
      },
      "exec_time":221
   },
   "language":"python",
   "version":"3.12.0"
}

vsecoder avatar Mar 02 '24 13:03 vsecoder