diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-04-19 14:27:08 +0200 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-04-19 14:35:25 +0200 |
commit | 229f3ce9cec8d525d960cabc7a915b47dfdcd910 (patch) | |
tree | 7707c50a6f115275c9c59efa29287ffbd972a928 /lib/gitlab/metrics.rb | |
parent | bfa16dbcfba2a3233209f6403a0074d42e664df6 (diff) | |
download | gitlab-ce-229f3ce9cec8d525d960cabc7a915b47dfdcd910.tar.gz |
Configuring of points per UDP packettoggle-points-per-packet
This allows users to configure the number of points stored in a single
UDP packet. This in turn can be used to reduce the number of UDP packets
being sent at the cost of these packets being somewhat larger.
The default setting is 1 point per packet so nothing changes for
existing users.
Diffstat (limited to 'lib/gitlab/metrics.rb')
-rw-r--r-- | lib/gitlab/metrics.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/metrics.rb b/lib/gitlab/metrics.rb index 484970c5a10..f82dce14865 100644 --- a/lib/gitlab/metrics.rb +++ b/lib/gitlab/metrics.rb @@ -14,7 +14,8 @@ module Gitlab method_call_threshold: current_application_settings[:metrics_method_call_threshold], host: current_application_settings[:metrics_host], port: current_application_settings[:metrics_port], - sample_interval: current_application_settings[:metrics_sample_interval] || 15 + sample_interval: current_application_settings[:metrics_sample_interval] || 15, + packet_size: current_application_settings[:metrics_packet_size] || 1 } end @@ -41,9 +42,9 @@ module Gitlab prepared = prepare_metrics(metrics) pool.with do |connection| - prepared.each do |metric| + prepared.each_slice(settings[:packet_size]) do |slice| begin - connection.write_points([metric]) + connection.write_points(slice) rescue StandardError end end |