The device used to measure the duration of bright sunshine is the Campbell–Stokes Sunshine Recorder (often just "sunshine recorder").
How it works: A solid glass sphere acts as a burning lens, focusing sunlight onto a graduated paper card mounted in a bowl behind it. As the sun traverses the sky, the focused beam burns a trace on the card. The length of the burn mark corresponds to hours of bright sunshine.
Cards are swapped daily (different shapes for summer/winter/equinox). It's a beautifully analog, zero-power meteorological standard still used worldwide alongside electronic pyranometers.