mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-18 09:52:27 +00:00
feat: enable native histogram ingestion by default (#9301)
* feat: enable native histogram ingestion by default Signed-off-by: shuiyisong <xixing.sys@gmail.com> * chore: add comments Signed-off-by: shuiyisong <xixing.sys@gmail.com> * fix: test Signed-off-by: shuiyisong <xixing.sys@gmail.com> --------- Signed-off-by: shuiyisong <xixing.sys@gmail.com>
This commit is contained in:
@@ -1139,7 +1139,6 @@ mod tests {
|
||||
fn test_toml() {
|
||||
let opts = StandaloneOptions::default();
|
||||
let toml_string = toml::to_string(&opts).unwrap();
|
||||
assert!(toml_string.contains("experimental_enable_exponential_histogram = false"));
|
||||
let parsed: StandaloneOptions = toml::from_str(&toml_string).unwrap();
|
||||
assert_eq!(parsed.otlp, opts.otlp);
|
||||
}
|
||||
|
||||
@@ -199,12 +199,6 @@ fn test_load_frontend_example_config() {
|
||||
let options =
|
||||
GreptimeOptions::<FrontendOptions>::load_layered_options(example_config.to_str(), "")
|
||||
.unwrap();
|
||||
assert!(
|
||||
!options
|
||||
.component
|
||||
.otlp
|
||||
.experimental_enable_exponential_histogram
|
||||
);
|
||||
let expected = GreptimeOptions::<FrontendOptions> {
|
||||
component: FrontendOptions {
|
||||
pending_rows_batcher: PendingRowsBatcherOptions {
|
||||
@@ -386,12 +380,6 @@ fn test_load_standalone_example_config() {
|
||||
let options =
|
||||
GreptimeOptions::<StandaloneOptions>::load_layered_options(example_config.to_str(), "")
|
||||
.unwrap();
|
||||
assert!(
|
||||
!options
|
||||
.component
|
||||
.otlp
|
||||
.experimental_enable_exponential_histogram
|
||||
);
|
||||
let expected = GreptimeOptions::<StandaloneOptions> {
|
||||
component: StandaloneOptions {
|
||||
pending_rows_batcher: PendingRowsBatcherOptions {
|
||||
@@ -448,40 +436,34 @@ fn test_load_standalone_example_config() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_load_otlp_exponential_histogram_option() {
|
||||
let config = tempfile::NamedTempFile::new().unwrap();
|
||||
std::fs::write(
|
||||
config.path(),
|
||||
"[otlp]\nexperimental_enable_exponential_histogram = true\n",
|
||||
)
|
||||
.unwrap();
|
||||
fn test_load_removed_histogram_options() {
|
||||
for enabled in [false, true] {
|
||||
let config = tempfile::NamedTempFile::new().unwrap();
|
||||
std::fs::write(
|
||||
config.path(),
|
||||
format!(
|
||||
"[otlp]\nexperimental_enable_exponential_histogram = {enabled}\n\
|
||||
[prom_store]\nenable = true\nwith_metric_engine = true\n\
|
||||
experimental_enable_prometheus_native_histogram = {enabled}\n"
|
||||
),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let frontend =
|
||||
GreptimeOptions::<FrontendOptions>::load_layered_options(config.path().to_str(), "")
|
||||
.unwrap();
|
||||
assert!(
|
||||
frontend
|
||||
.component
|
||||
.otlp
|
||||
.experimental_enable_exponential_histogram
|
||||
);
|
||||
|
||||
let standalone =
|
||||
GreptimeOptions::<StandaloneOptions>::load_layered_options(config.path().to_str(), "")
|
||||
.unwrap();
|
||||
assert!(
|
||||
standalone
|
||||
.component
|
||||
.otlp
|
||||
.experimental_enable_exponential_histogram
|
||||
);
|
||||
assert!(
|
||||
standalone
|
||||
.component
|
||||
.frontend_options()
|
||||
.otlp
|
||||
.experimental_enable_exponential_histogram
|
||||
);
|
||||
let frontend =
|
||||
GreptimeOptions::<FrontendOptions>::load_layered_options(config.path().to_str(), "")
|
||||
.unwrap();
|
||||
let standalone =
|
||||
GreptimeOptions::<StandaloneOptions>::load_layered_options(config.path().to_str(), "")
|
||||
.unwrap();
|
||||
let defaults = FrontendOptions::default();
|
||||
for options in [frontend.component, standalone.component.frontend_options()] {
|
||||
assert_eq!(options.otlp, defaults.otlp);
|
||||
assert_eq!(options.prom_store, defaults.prom_store);
|
||||
let serialized = toml::to_string(&options).unwrap();
|
||||
assert!(!serialized.contains("experimental_enable_exponential_histogram"));
|
||||
assert!(!serialized.contains("experimental_enable_prometheus_native_histogram"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user