Class: DatadogCompoundMetrics
- Inherits:
-
Object
- Object
- DatadogCompoundMetrics
show all
- Defined in:
- lib/datadog_compound_metrics.rb,
lib/datadog_compound_metrics/version.rb,
lib/datadog_compound_metrics/configuration.rb,
lib/datadog_compound_metrics/compound_metric.rb,
lib/datadog_compound_metrics/compound_metrics_worker.rb
Defined Under Namespace
Modules: Version
Classes: CompoundMetric, CompoundMetricsWorker, Configuration
Constant Summary
collapse
- VERSION =
"0.1.0"
Class Method Summary
collapse
Class Method Details
.add_compound_metric(metric_name) {|compound_metric| ... } ⇒ Object
28
29
30
31
32
|
# File 'lib/datadog_compound_metrics.rb', line 28
def self.add_compound_metric(metric_name)
compound_metric = DatadogCompoundMetrics::CompoundMetric.new(metric_name)
yield compound_metric
compound_metrics << compound_metric
end
|
.compound_metrics ⇒ Object
34
35
36
|
# File 'lib/datadog_compound_metrics.rb', line 34
def self.compound_metrics
@compound_metrics ||= []
end
|
24
25
26
|
# File 'lib/datadog_compound_metrics.rb', line 24
def self.configure
yield configuration
end
|
.loader ⇒ Object
14
15
16
17
18
|
# File 'lib/datadog_compound_metrics.rb', line 14
def self.loader
@loader ||= Zeitwerk::Loader.for_gem.tap do |loader|
loader.ignore("#{__dir__}/datadog-compound-metrics.rb")
end
end
|
.reset_config ⇒ Object
49
50
51
|
# File 'lib/datadog_compound_metrics.rb', line 49
def self.reset_config
@configuration = nil
end
|
.reset_metrics ⇒ Object
53
54
55
|
# File 'lib/datadog_compound_metrics.rb', line 53
def self.reset_metrics
@compound_metrics = []
end
|
.schedule_job ⇒ Object
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/datadog_compound_metrics.rb', line 38
def self.schedule_job
Sidekiq::Cron::Job.create(
name: "DatadogCompoundMetrics::CompoundMetricsWorker",
cron: configuration.sidekiq_cron_schedule,
class: "DatadogCompoundMetrics::CompoundMetricsWorker",
queue: configuration.sidekiq_queue,
args: [],
active_job: false
)
end
|