The length of the curve is the following:
$ \int_0^{2\pi}\sqrt{(x'(t))^2+(y'(t))^2}dt \\ =\int_0^{2\pi} \sqrt{(1-\cos t)^2 + (\sin t)^2}dt \\ =\int_0^{2\pi}\sqrt{1-2\cos t + \cos^2 t + \sin^2 t}dt \\ =\int_0^{2\pi}\sqrt{2-2\cos t}dt \\ =\int_0^{2\pi}\sqrt{2}\sqrt{1-\cos t}dt. $
Now recall one of the half-angle formulas: $\sin^2 u = \dfrac{1}{2}-\dfrac{1}{2}\cos (2u)$. Plug in $t = 2u$ to obtain $ \sin^2 \left(\frac{t}{2}\right) = \dfrac{1}{2}-\dfrac{1}{2}\cos (t), $ which is the same as $ 2 \sin^2 \left(\frac{t}{2}\right) = 1- \cos (t). $
Returning back to our integral and making appropriate substitutions, we obtain $ \int_0^{2\pi}\sqrt{2}\sqrt{2 \sin^2\left(\frac{t}{2}\right)}dt \\ = \int_0^{2\pi} 2 \sin \left( \dfrac{t}{2}\right) dt\\ = 2\int_0^{2\pi}\sin\left( \frac{t}{2}\right) dt. \\ $
Finally, we finish by making a substitution: let $v = t/2$. Then $dv = dt/2$. This is called a $u$-substitution but in order to avoid confusion, I'm using the letter $v$ instead.
Thus, we conclude
$ 2 \int_0^{\pi}\sin v (2dv) \\ = 4 \int_0^{\pi} \sin v dv \\ = -4 \cos v |_0^{\pi} \\ = -4(-1-1) = -4 (-2) = 8. $