Sometimes gathering some telemetry data may be slightly more computationally expensive, and it would be handy to compute these values only if there is anyone recording these metrics. So the proposed functionality would be new function telemetry:execute/2 that will take function fun () -> {Measurements :: map(), Meta :: map()} as a second argument that will run that function only if telemetry_handler_table:list_for_event/1 will return non empty list.
Sometimes gathering some telemetry data may be slightly more computationally expensive, and it would be handy to compute these values only if there is anyone recording these metrics. So the proposed functionality would be new function
telemetry:execute/2that will take functionfun () -> {Measurements :: map(), Meta :: map()}as a second argument that will run that function only iftelemetry_handler_table:list_for_event/1will return non empty list.