Skip to content
Snippets Groups Projects
Commit c8afda2c authored by Jorn van de Beek's avatar Jorn van de Beek
Browse files

Use tags to specify task/probe names

parent 729079a4
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
......@@ -8,7 +8,7 @@ GIT
PATH
remote: .
specs:
roqua-support (0.3.0)
roqua-support (0.3.1)
active_interaction (~> 3.0)
activesupport (>= 3.2, < 6)
naught (~> 1.0)
......
......@@ -17,7 +17,7 @@ module Roqua
# do not override me, implement probes by implementing the #run method
def call
run
Appsignal.increment_counter("probe.call.completed.#{self.class.name.demodulize.underscore}", 1)
Appsignal.increment_counter("probe.call.completed", 1, probe_name: self.class.name.demodulize.underscore)
end
end
end
......
......@@ -42,7 +42,7 @@ class Roqua::Scheduling::Scheduler
task = schedule.tasks[cron_job.name]
task.run
Appsignal.increment_counter("scheduler.run_task.completed.#{task.name}", 1)
Appsignal.increment_counter("scheduler.run_task.completed", 1, task_name: task.name)
cron_job.update completed_at: Time.now, next_run_at: task.next_run_at
end
end
......@@ -32,7 +32,7 @@ describe Roqua::Probes::DelayedJobProbe do
end
it 'increments the probe call counter' do
expect(Appsignal).to receive(:increment_counter).with('probe.call.completed.delayed_job_probe', 1)
expect(Appsignal).to receive(:increment_counter).with('probe.call.completed', 1, probe_name: "delayed_job_probe")
probe.call
end
end
......
......@@ -21,7 +21,7 @@ describe Roqua::Probes::MonitoringProbe do
end
it 'increments the probe call counter' do
expect(Appsignal).to receive(:increment_counter).with('probe.call.completed.monitoring_probe', 1)
expect(Appsignal).to receive(:increment_counter).with('probe.call.completed', 1, probe_name: "monitoring_probe")
probe.call
end
end
......
......@@ -86,7 +86,7 @@ describe Roqua::Scheduling::Scheduler do
end
it 'counts task calls' do
expect(Appsignal).to receive(:increment_counter).with('scheduler.run_task.completed.hourly', 1)
expect(Appsignal).to receive(:increment_counter).with('scheduler.run_task.completed', 1, task_name: 'hourly')
subject.ping
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment