Method: NewRelic::Agent::StatsEngine#tl_record_unscoped_metrics
- Defined in:
- lib/new_relic/agent/stats_engine.rb
permalink #tl_record_unscoped_metrics(metric_names, value = nil, aux = nil, &blk) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Update the unscoped metrics given in metric_names. metric_names may be either a single name, or an array of names.
This is an internal method, subject to change at any time. Client apps and gems should use the public API (NewRelic::Agent.record_metric) instead.
There are four ways to use this method:
-
With a numeric value, it will update the Stats objects associated with the given metrics by calling record_data_point(value, aux). aux will be treated in this case as the exclusive time associated with the call being recorded.
-
With a value of :apdex_s, :apdex_t, or :apdex_f, it will treat the associated stats as an Apdex metric, updating it to reflect the occurrence of a transaction falling into the given category. The aux value in this case should be the apdex threshold used in bucketing the request.
-
If a block is given, value and aux will be ignored, and instead the Stats object associated with each named unscoped metric will be yielded to the block for customized update logic.
-
If value is a Stats instance, it will be merged into the Stats associated with each named unscoped metric.
If this method is called during a transaction, the metrics will be attached to the Transaction, and not merged into the global set until the end of the transaction.
Otherwise, the metrics will be recorded directly into the global set of metrics, under a lock.
63 64 65 66 |
# File 'lib/new_relic/agent/stats_engine.rb', line 63 def tl_record_unscoped_metrics(metric_names, value = nil, aux = nil, &blk) state = NewRelic::Agent::Tracer.state record_unscoped_metrics(state, metric_names, value, aux, &blk) end |