  We define an integer-valued non-degenerate bi-invariant metric (the
discriminant metric) on the universal cover of the identity component of the
contactomorphism group of any contact manifold. This metric has a very simple
geometric definition, based on the notion of discriminant points of
contactomorphisms. Using generating functions we prove that the discriminant
metric is unbounded for the standard contact structures on R^{2n} x S^1 and
RP^{2n+1}. On the other hand we also show by elementary arguments that the
discriminant metric is bounded for the standard contact structures on R^{2n+1}
and S^{2n+1}. As an application of these results we get that the contact
fragmentation norm is unbounded for R^{2n} x S^1 and RP^{2n+1}. By elaborating
on the construction of the discriminant metric we then define a second
integer-valued bi-invariant metric, that we call the discriminant oscillation
metric. This second metric is non-degenerate if and only if the contact
manifold is orderable in the sense of Eliashberg and Polterovich and, in this
case, it is compatible with the partial order. Finally we define the
discriminant and oscillation lengths of a Legendrian isotopy, and prove that
they are unbounded for T^{\ast}B x S^1 for any closed manifold B, for RP^{2n+1}
and for some 3-dimensional circle bundles.
