Overview. Polysomnography, known as a sleep study, is a test used to diagnose sleep disorders. Polysomnography records your brain waves, the oxygen level in your blood, and your heart rate and breathing during sleep. It also measures eye and leg movements.