to conveniently and succinctly profile functions
# -- in module examples.foobar --
import torch.distributed.elastic.metrics as metrics
metrics.configure(metrics.ConsoleMetricsHandler(), "foobar")
   metrics.configure(metrics.ConsoleMetricsHandler(), "Bar")
@metrics.prof
   def foo():
     pass
class Bar():
 @metrics.prof
 def baz():
     pass

"@metrics.prof" will publish the following metrics
.success - 1 if the function finished successfully
   .failure - 1 if the function threw an exception
   .duration.ms - function duration in milliseconds
Configuring Metrics Handler:
torch.distributed.elastic.metrics.MetricHandler is responsible for
emitting the added metric values to a particular destination. Metric
groups can be configured with different metric handlers.
By default torchelastic emits all metrics to "/dev/null". By adding