Measurements of coherent diffraction radiation and its application for bunch length diagnostics in particle accelerators