method

record

rails latest stable - Class: ActiveRecord::RuntimeRegistry

Method not available on this version

This method is only available on newer versions. The first available version (v8.1.1) is shown here.

record(query_name, runtime, cached: false, async: false, lock_wait: nil)
public

No documentation available.

# File activerecord/lib/active_record/runtime_registry.rb, line 41
    def record(query_name, runtime, cached: false, async: false, lock_wait: nil)
      stats = self.stats

      unless query_name == "TRANSACTION" || query_name == "SCHEMA"
        stats.queries_count += 1
        stats.cached_queries_count += 1 if cached
      end

      if async
        stats.async_sql_runtime += (runtime - lock_wait)
      end
      stats.sql_runtime += runtime
    end