Mass formulas for local Galois representations