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 × 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 × S 1 and RP 2n+1 . By elaborating on the construction of the discriminant metric we then define an integer-valued bi-invariant pseudo-metric, that we call the oscillation pseudo-metric, which 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 * B × S 1 for any closed manifold B, for RP 2n+1 and for some 3-dimensional circle bundles.1 Recall that any conjugation-invariant norm ν : G → [0, +∞) on a group G induces a bi-invariant metric dν on G by defining dν (f, g) = ν(f −1 g). 2 If M is not compact, we will consider the discriminant norm on the universal cover of the identity component of the group of compactly supported contactomorphisms.