partial js for metric loop, JSON jenky, but well formed