Sha256: 98c4ee9e78dffb20cb58094e5b36fb2f145aee5472267960eeb144caf72fb113

Contents?: true

Size: 1.23 KB

Versions: 96

Compression:

Stored size: 1.23 KB

Contents

module CassandraObject
  class LogSubscriber < ActiveSupport::LogSubscriber
    def multi_get(event)
      name = '%s multi_get (%.1fms)' % [event.payload[:column_family], event.duration]

      debug "  #{name}  (#{event.payload[:keys].size}) #{event.payload[:keys].join(" ")}"
    end

    def remove(event)
      name = '%s remove (%.1fms)' % [event.payload[:column_family], event.duration]

      message = "  #{name}  #{event.payload[:key]}"
      message << " #{Array(event.payload[:attributes]).inspect}" if event.payload[:attributes]

      debug message
    end

    def truncate(event)
      name = '%s truncate (%.1fms)' % [event.payload[:column_family], event.duration]

      debug "  #{name}  #{event.payload[:column_family]}"
    end

    def insert(event)
      name = '%s insert (%.1fms)' % [event.payload[:column_family], event.duration]

      debug "  #{name}  #{event.payload[:key]} #{event.payload[:attributes].inspect}"
    end

    def get_range(event)
      name = '%s get_range (%.1fms)' % [event.payload[:column_family], event.duration]
      
      debug "  #{name}  (#{event.payload[:count]}) '#{event.payload[:start]}' => '#{event.payload[:finish]}'"
    end
  end
end
CassandraObject::LogSubscriber.attach_to :cassandra_object

Version data entries

96 entries across 96 versions & 2 rubygems

Version Path
gotime-cassandra_object-2.11.6 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.11.5 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.11.4 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.11.3 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.11.2 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.11.1 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.11.0 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.11 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.10 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.9 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.8 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.7 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.6 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.5 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.4 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.3 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.2 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.1 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.10.0 lib/cassandra_object/log_subscriber.rb
gotime-cassandra_object-2.9.2 lib/cassandra_object/log_subscriber.rb