Sha256: c824c29598e26611011abb0dc2fc994e7cd1b9cb9d40b91ab3024147933fa405

Contents?: true

Size: 843 Bytes

Versions: 2

Compression:

Stored size: 843 Bytes

Contents

module Stopwatch
  class Log
    @@query_count = 0
    @@sub_query_count = 0
    @@events = []

    def self.event
      @@event
    end
    def self.event=(event)
      @@event = event
    end

    def self.events
      @@events
    end
    def self.events=(events)
      @@events = events
    end

    def self.query_count
      @@query_count
    end
    def self.query_count=(query_count)
      @@query_count = query_count
    end

    def self.sub_query_count
      @@sub_query_count
    end

    def self.reset_query_count
      @@query_count = 0
    end

    def self.reset_sub_query_count
      @@sub_query_count = 0
    end

    def self.increment_query_count
      @@query_count += 1
    end

    def self.increment_sub_query_count
      @@sub_query_count += 1
    end

    def self.reset_events
      @@events = []
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stopwatch-1.0.1 lib/stopwatch/log.rb
stopwatch-1.0.0 lib/stopwatch/log.rb