C++ library for collecting user-defined in-process runtime statistics with low overhead