The judge may in his discretion order a reference to a referee agreed upon or appointed by him, to report the evidence of the facts.