Watching your heart beat

In preparation for running the marathon I bought a heart monitor. It’s a useful aid to pitch your training at the right intensity. I wore it to sleep one night to try and get a good read on my resting heart rate. I had expected to see a gradual drop and steady low rate. But when I downloaded the data I was surprised to see this: