Complete a circular buffer so we don't log too much data, config
settings for turning it on and off (default off, becuase performance)
and for changing the size of the buffer, an excmd for dumping the raw
json so you can pore over it, and for when you just want to
sanity-check yourself instead of groveling over your data for six days
with a deep learning toolkit and three hundred CPUs of compute, an
excmd for pretty-printing your stats in a nice histogram.
I didn't think far enough ahead and only implemented the easy way to
instrument a function, which is with a decorator. I'm getting _really_
angry at typescript not being able to handle decorators on free
functions. bah. I'll figure out a good way to wrap free
functions. Maybe just go the stupid route and make you change
`export async function foo(args)` to `export foo = measured(async
function(args) ...`. But that would break excmd parsing, so... :/
I think that I already want to do a refactor to break excmd.ts into a
bunch of one-line wrappers referencing implementations spread
throughout a bunch of libraries. This would go nicely with that.
Other things I did while I was here:
* Fix the ugliness we had with (window as any).tri by monkey-patching
the tri property into the window object in tridactyl.d.ts
Motivation:
- Most test frameworks expect modules
- I'm told they're the future
Changes:
- Every typescript source file is now an es6 module
- Build system is now webpack (tho rollup makes nicer outputs)
- Outputs of buildsystem are one js file per entry point (background,
content, commandline_frame)
- These bundled js files are generated by traversing the dependency
graph of each entry point