metrics: implement basics
mainloop: instrument with metrics