We associate to a test configuration for a polarized variety a filtration of the section ring of the line bundle. Using the recent work of Boucksom and Chen we get a concave function on the Okounkov body whose law with respect to Lebesgue measure determines the asymptotic distribution of the weights of the test configuration. We show that this is a generalization of a well-known result in toric geometry. As an application, we prove that the pushforward of the Lebesgue measure on the Okounkov body is equal to a Duistermaat–Heckman measure of a certain deformation of the manifold. Via the Duisteraat–Heckman formula, we get as a corollary that in the special case of an effective ℂ×-action on the manifold lifting to the line bundle, the pushforward of the Lebesgue measure on the Okounkov body is piecewise polynomial.