zuora_connect 1.7.01 → 1.7.02
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/zuora_connect/app_instance_base.rb +20 -22
- data/lib/zuora_connect/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 594401d6339de6b47b3fb18df373885602d46cf2
|
4
|
+
data.tar.gz: 1e04f4996a73181a28cbd49a54544df4aaaab95c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 124d750f69180609410a6eb3e0fca28ce8faa9fbc67b93e65c79342aa70e9d1bf1746bbe3eda7874ec74efcecb25c0af47cc08d18ae9ddfa6523d01e95543b43
|
7
|
+
data.tar.gz: 3689ba84238f716ed5d37bdd3718439154e34081fd6acade2936333141b81f0ec70f352eec94a3ac1749812aef095bc9cf5fc8f748ab561972e80ca40567e349
|
@@ -60,30 +60,28 @@ module ZuoraConnect
|
|
60
60
|
|
61
61
|
# Write to telegraf
|
62
62
|
def self.write_to_telegraf(direction: nil, tags: {}, values: {})
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
self.write_metric(series: series, tags: tags, values: values)
|
78
|
-
end
|
79
|
-
|
63
|
+
time = Benchmark.measure do |bench|
|
64
|
+
# To avoid writing metrics from rspec tests
|
65
|
+
if ENV['DEIS_APP'] || true
|
66
|
+
# Getting the process type
|
67
|
+
p_type = self.get_process_type
|
68
|
+
app_instance = Thread.current[:appinstance].present? ? Thread.current[:appinstance].id : 0
|
69
|
+
tags = tags.merge({ app_name: ZuoraConnect.configuration.app_name, process_type: p_type, app_instance: app_instance})
|
70
|
+
|
71
|
+
if direction == :inbound && ZuoraConnect.configuration.enable_inbound_metrics_flag
|
72
|
+
series = ZuoraConnect.configuration.influxdb_series_name_inbound
|
73
|
+
self.write_metric(series: series, tags: tags, values: values)
|
74
|
+
elsif direction == :outbound && ZuoraConnect.configuration.enable_outbound_metrics_flag
|
75
|
+
series = ZuoraConnect.configuration.influxdb_series_name_outbound
|
76
|
+
self.write_metric(series: series, tags: tags, values: values)
|
80
77
|
end
|
78
|
+
|
81
79
|
end
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
80
|
+
end
|
81
|
+
if ZuoraConnect.configuration.telegraf_debug
|
82
|
+
Rails.logger.debug(tags.to_s)
|
83
|
+
Rails.logger.debug(values.to_s)
|
84
|
+
Rails.logger.debug("Writing #{direction.capitalize}: #{time.real.round(4)}")
|
87
85
|
end
|
88
86
|
end
|
89
87
|
|