A function $f:[a,b]\to\mathbb{R}$ is said to be of bounded variation if $$ \sup_I \sum_{i=1}^n |f(x_i)-f(x_{i-1})| \le V $$ for some finite $V>0$, where the supremum is over all finite partitions $I=(a=x_0<x_1<\ldots<x_n=b)$ of $[a,b]$. I am looking for metric-space analogues of this notion.
One natural idea is to consider a function $f:X\to\mathbb{R}$, where $(X,d)$ is a bounded metric space. We can define $f$ to be of bounded variation if $$ \sup_{\mathcal{P}} \sum_{A\in\mathcal{P}} (\sup_A f-\inf_A f) \le V,$$ where $\mathcal{P}$ is the collection of all finite partitions of $X$. Has this notion been studied somewhere?
EDIT: Following @August Cleaner's comment: of course something is missing from the above: the metric! I should have defined it as something like $$ \sup_{\epsilon>0}\sup_{\mathcal{P}_\epsilon} \sum_{A\in\mathcal{P}_\epsilon} (\sup_A f-\inf_A f) \le V,$$ where $\mathcal{P}_\epsilon$ is a finite partition where each block has diameter at most $\epsilon$. That at least agrees with the standard definition on $[a,b]$, I think.
EDIT II: Following Martin Hairer's example, here's a third attempt. For $x_1,\ldots,x_n\in X$, we can define the Voronoi partition induced by this finite set: every $x\in X$ is associated with the closest $x_i$. [There's the issue of how to break ties, but we're going to consider all such partitions and hence all possible tie-breaking schemes.] Let $\mathcal{P}_n$ be the collection of all Voronoi partitions induced by $n$ points, and say that $f:X\to\mathbb{R}$ has bounded variation if $$ \sup_{n>0}\sup_{\mathcal{P}_n} \sum_{A\in\mathcal{P}_n} (\sup_A f-\inf_A f) \le V.$$ Any comments on this definition?