  The purpose of the present paper is to set up a formalism inspired from
non-Archimedean geometry to study K-stability. We first provide a detailed
analysis of Duistermaat-Heckman measures in the context of test configurations,
characterizing in particular the trivial case. For any normal polarized variety
(or, more generally, polarized pair in the sense of the Minimal Model Program),
we introduce and study the non-Archimedean analogues of certain classical
functionals in K\"ahler geometry. These functionals are defined on the space of
test configurations, and the Donaldson-Futaki invariant is in particular
interpreted as the non-Archimedean version of the Mabuchi functional, up to an
explicit error term. Finally, we study in detail the relation between uniform
K-stability and singularities of pairs, reproving and strengthening Y. Odaka's
results in our formalism. This provides various examples of uniformly K-stable
varieties.
