  Let $(X, \xi)$ be a polarized affine variety, i.e. an affine variety $X$ with
a (possibly irrational) Reeb vector field $\xi$. We define the volume of a
filtration of the coordinate ring of $X$ in terms of the asymptotics of the
average of jumping numbers. When the filtration is finitely generated, it
induces a Fubini-Study function $\varphi$ on the Berkovich analytification of
$X$. In this case, we define the Monge-Amp\`ere energy for $\varphi$ using the
theory of forms and currents on Berkovich spaces developed by Chambert-Loir and
Ducros, and show that it agrees with the volume of the filtration. In the
special case when the filtration comes from a test configuration, we recover
the functional defined by Collins-Sz\'ekelyhidi and Li-Xu.
