Sha256: 6ba74cb85db767d1b39858afc2d2a5bce9c7b00be44785d2baae0d9507a9e3a2
Contents?: true
Size: 1.21 KB
Versions: 6
Compression:
Stored size: 1.21 KB
Contents
require 'helper' require 'simple_uuid' require 'cassanity/instrumentation/metriks' describe Cassanity::Instrumentation::MetriksSubscriber do let(:client) { Cassanity::Client.new(CassanityHost, CassanityPort, { instrumenter: ActiveSupport::Notifications, }) } let(:keyspace) { client[:cassanity_test] } let(:column_family) { keyspace.column_family({ name: :apps, schema: { primary_key: :id, columns: { id: :timeuuid, name: :text, }, }, }) } before do keyspace.recreate column_family.recreate end it "updates timers when cql calls happen" do # Clear the registry so we don't count the operations required to re-create # the keyspace and column family. Metriks::Registry.default.clear column_family.insert({ data: { id: SimpleUUID::UUID.new, name: 'GitHub.com', }, }) Metriks.timer('cassanity.cql').count.should be(1) Metriks.timer('cassanity.column_family.apps.cql').count.should be(1) Metriks.timer('cassanity.command.column_family_insert.cql').count.should be(1) Metriks.timer('cassanity.column_family.apps.column_family_insert.cql').count.should be(1) end end
Version data entries
6 entries across 6 versions & 1 rubygems