From 3508f846e7c598ccab4f0b088e212ff1456a7055 Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Wed, 29 Mar 2023 08:03:13 +0200 Subject: [PATCH] pet the cyber canine 9000 --- lib/retrospring/metrics.rb | 26 +++++++++++++------------- spec/models/user_spec.rb | 6 +++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/retrospring/metrics.rb b/lib/retrospring/metrics.rb index 3c715e5c..9c5ea3bb 100644 --- a/lib/retrospring/metrics.rb +++ b/lib/retrospring/metrics.rb @@ -24,65 +24,65 @@ module Retrospring labels: [:version], preset_labels: { version: Retrospring::Version.to_s, - } + }, ).tap { _1.set 1 } QUESTIONS_ASKED = counter( :retrospring_questions_asked_total, docstring: "How many questions got asked", - labels: %i[anonymous followers generated] + labels: %i[anonymous followers generated], ) QUESTIONS_ANSWERED = counter( :retrospring_questions_answered_total, - docstring: "How many questions got answered" + docstring: "How many questions got answered", ) COMMENTS_CREATED = counter( :retrospring_comments_created_total, - docstring: "How many comments got created" + docstring: "How many comments got created", ) USERS_CREATED = counter( :retrospring_users_created_total, - docstring: "How many users got created" + docstring: "How many users got created", ) USERS_DESTROYED = counter( :retrospring_users_destroyed_total, - docstring: "How many users deleted their accounts" + docstring: "How many users deleted their accounts", ) # metrics from Sidekiq::Stats.new SIDEKIQ = { processed: gauge( :sidekiq_processed, - docstring: "Number of jobs processed by Sidekiq" + docstring: "Number of jobs processed by Sidekiq", ), failed: gauge( :sidekiq_failed, - docstring: "Number of jobs that failed" + docstring: "Number of jobs that failed", ), scheduled_size: gauge( :sidekiq_scheduled_jobs, - docstring: "Number of jobs that are enqueued" + docstring: "Number of jobs that are enqueued", ), retry_size: gauge( :sidekiq_retried_jobs, - docstring: "Number of jobs that are being retried" + docstring: "Number of jobs that are being retried", ), dead_size: gauge( :sidekiq_dead_jobs, - docstring: "Number of jobs that are dead" + docstring: "Number of jobs that are dead", ), processes_size: gauge( :sidekiq_processes, - docstring: "Number of active Sidekiq processes" + docstring: "Number of active Sidekiq processes", ), queue_enqueued: gauge( :sidekiq_queues_enqueued, docstring: "Number of enqueued jobs per queue", - labels: %i[queue] + labels: %i[queue], ), }.freeze end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index b3fe0836..6a938a48 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -10,7 +10,7 @@ RSpec.describe User, type: :model do @user = User.new( screen_name: "FunnyMeme2004", password: "y_u_no_secure_password?", - email: "nice.meme@nsa.gov" + email: "nice.meme@nsa.gov", ) Profile.new(user: @user) end @@ -108,7 +108,7 @@ RSpec.describe User, type: :model do describe "email validation" do subject do - FactoryBot.build(:user, email: email).tap(&:validate).errors[:email] + FactoryBot.build(:user, email:).tap(&:validate).errors[:email] end shared_examples_for "valid email" do |example_email| @@ -255,7 +255,7 @@ RSpec.describe User, type: :model do describe "#cursored_timeline" do let(:last_id) { nil } - subject { me.cursored_timeline(last_id: last_id, size: 3) } + subject { me.cursored_timeline(last_id:, size: 3) } context "user answered nothing and is not following anyone" do include_examples "result is blank"