Given integers
$g,n\geqslant 0$
satisfying
$2-2g-n<0$
, let
${\mathcal{M}}_{g,n}$
be the moduli space of connected, oriented, complete, finite area hyperbolic surfaces of genus
$g$
with
$n$
cusps. We study the global behavior of the Mirzakhani function
$B:{\mathcal{M}}_{g,n}\rightarrow \mathbf{R}_{{\geqslant}0}$
which assigns to
$X\in {\mathcal{M}}_{g,n}$
the Thurston measure of the set of measured geodesic laminations on
$X$
of hyperbolic length
${\leqslant}1$
. We improve bounds of Mirzakhani describing the behavior of this function near the cusp of
${\mathcal{M}}_{g,n}$
and deduce that
$B$
is square-integrable with respect to the Weil–Petersson volume form. We relate this knowledge of
$B$
to statistics of counting problems for simple closed hyperbolic geodesics.