aports/testing/rezolus/remove-http-sampler.patch
2021-04-13 19:23:59 +02:00

122 lines
3.5 KiB
Diff

From: Jakub Jirutka <jakub@jirutka.cz>
Date: Tue, 13 Apr 2021 19:14:53 +0200
Subject: [PATCH] Remove http sampler to decrease size and dependencies
http sampler increases size of the rezolus binary from 2.5 MiB to 4.1 MiB
(opt-level="z", panic="abort", lto, stripped) and adds dependency on libssl
and libcrypto.
I think that it's a bit out of scope of the Rezolus purpose and there are
better tools for this. If there will be demand for this sampler, we can
build and provide two variants of rezolus (e.g. rezolus and rezolus-http).
--- a/configs/example.toml
+++ b/configs/example.toml
@@ -127,48 +127,6 @@
# "p99",
# ]
-# This sampler reads from a JSON key-value http endpoint and can calculate
-# percentile metrics for configured counters and gauges. It is intended to be
-# used for host-local http endpoints to avoid introducing noise into the
-# percentiles due to variable request service time.
-# [samplers.http]
-# Controls whether to use this sampler
-# enabled = false
-
-# Specify the full URL to read JSON metrics from
-# url = "http://0.0.0.0:8080/vars.json"
-
-# Sampling interval, in milliseconds, for this sampler
-# interval = 1000
-
-# Specify raw metric names that should be treated as counters and have
-# percentile metrics calculated. The percentiles will be of secondly rates seen
-# calculated from the difference in consecutive readings and the elapsed time
-# between those readings.
-# counters = [
-# # "some_counter_metric",
-# ]
-
-# Specify raw metric names that should be treated as gauges and have percentile
-# metrics calculated. The percentiles will be of instantaneous gauge values.
-# gauges = [
-# # "some_gauge_metric",
-# ]
-
-# Enable pass-through of raw metric readings. The names will have the reading
-# suffix appended to them, see the general config section.
-# passthrough = false
-
-# The set of exported percentiles can be controlled by specifying them here
-# percentiles = [
-# "p1",
-# "p10",
-# "p50",
-# "p90",
-# "p99",
-# ]
-
-
# The interrupt sampler provides telemetry about system interrupts
[samplers.interrupt]
# Controls whether to use this sampler
--- a/src/config/samplers.rs
+++ b/src/config/samplers.rs
@@ -7,7 +7,6 @@
use samplers::cpu::CpuConfig;
use samplers::disk::DiskConfig;
use samplers::ext4::Ext4Config;
-use samplers::http::HttpConfig;
use samplers::interrupt::InterruptConfig;
use samplers::memcache::MemcacheConfig;
use samplers::memory::MemoryConfig;
@@ -31,8 +30,6 @@
#[serde(default)]
ext4: Ext4Config,
#[serde(default)]
- http: HttpConfig,
- #[serde(default)]
interrupt: InterruptConfig,
#[serde(default)]
memcache: MemcacheConfig,
@@ -71,10 +68,6 @@
&self.ext4
}
- pub fn http(&self) -> &HttpConfig {
- &self.http
- }
-
pub fn interrupt(&self) -> &InterruptConfig {
&self.interrupt
}
--- a/src/main.rs
+++ b/src/main.rs
@@ -78,7 +78,6 @@
Cpu::spawn(common.clone());
Disk::spawn(common.clone());
Ext4::spawn(common.clone());
- Http::spawn(common.clone());
Interrupt::spawn(common.clone());
Memcache::spawn(common.clone());
Memory::spawn(common.clone());
--- a/src/samplers/mod.rs
+++ b/src/samplers/mod.rs
@@ -18,7 +18,6 @@
pub mod cpu;
pub mod disk;
pub mod ext4;
-pub mod http;
pub mod interrupt;
pub mod memcache;
pub mod memory;
@@ -35,7 +34,6 @@
pub use cpu::Cpu;
pub use disk::Disk;
pub use ext4::Ext4;
-pub use http::Http;
pub use interrupt::Interrupt;
pub use memcache::Memcache;
pub use memory::Memory;