Openlayers3 knows the actual distance, how to calculate the pixel distance on the screen?

use openlayers3 for map positioning, now the range of map positioning is 1km, how to calculate the pixel distance of 1km at the current level on the map? Or how to get the current level scale. Ol rookie, ask the gods for help

Mar.24,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34df0-4d5e8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34df0-4d5e8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?