lib, interface and ref implementations for recording measurements