Avoid String#replaceAll in SingleMetric#toJson

String#replaceAll recompiles the provided pattern over and over again.
Besides we just want to concat a few strings here

As SingleMetricSingleMetric#toJson may be called _a lot_ when many metrics
are coming here, it's better not to make heavy work there.