Measuring irreversible dynamics of a quantum harmonic oscillator