Skip to content

Commit

Permalink
refactor(meta): add system parameters for minitrace
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx committed Jun 25, 2024
1 parent 2ee7576 commit 53eab7f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions proto/meta.proto
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,9 @@ message SystemParams {
optional string wasm_storage_url = 14 [deprecated = true];
optional bool enable_tracing = 15;
optional bool use_new_object_prefix_strategy = 16;
optional bool minitrace = 17;
optional uint32 minitrace_tiered_cache_read_ms = 18;
optional uint32 minitrace_tiered_cache_write_ms = 19;
}

message GetSystemParamsRequest {}
Expand Down
8 changes: 7 additions & 1 deletion src/common/src/system_param/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ macro_rules! for_all_params {
{ max_concurrent_creating_streaming_jobs, u32, Some(1_u32), true, "Max number of concurrent creating streaming jobs.", },
{ pause_on_next_bootstrap, bool, Some(false), true, "Whether to pause all data sources on next bootstrap.", },
{ enable_tracing, bool, Some(false), true, "Whether to enable distributed tracing.", },
{ use_new_object_prefix_strategy, bool, None, false, "Whether to split object prefix.", },
{ use_new_object_prefix_strategy, bool, None, false, "Whether to split object prefix.", },
{ minitrace, bool, Some(false), true, "Whether to enable minitrace tracing.", },
{ minitrace_tiered_cache_read_ms, u32, Some(1000), true, "Threshold to record tiered cache read with minitrace.", },
{ minitrace_tiered_cache_write_ms, u32, Some(1000), true, "Threshold to record tiered cache write with minitrace.", },
}
};
}
Expand Down Expand Up @@ -444,6 +447,9 @@ mod tests {
(PAUSE_ON_NEXT_BOOTSTRAP_KEY, "false"),
(ENABLE_TRACING_KEY, "true"),
(USE_NEW_OBJECT_PREFIX_STRATEGY_KEY, "false"),
(MINITRACE_KEY, "false"),
(MINITRACE_TIERED_CACHE_READ_MS_KEY, "1000"),
(MINITRACE_TIERED_CACHE_WRITE_MS_KEY, "1000"),
("a_deprecated_param", "foo"),
];

Expand Down
12 changes: 12 additions & 0 deletions src/common/src/system_param/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,16 @@ where
.enable_tracing
.unwrap_or_else(default::enable_tracing)
}

fn minitrace(&self) -> bool {
self.inner().minitrace.unwrap_or(false)
}

fn minitrace_tiered_cache_read_ms(&self) -> u32 {
self.inner().minitrace_tiered_cache_read_ms.unwrap_or(1000)
}

fn minitrace_tiered_cache_write_ms(&self) -> u32 {
self.inner().minitrace_tiered_cache_write_ms.unwrap_or(1000)
}
}
3 changes: 3 additions & 0 deletions src/config/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ This page is automatically generated by `./risedev generate-example-config`
| data_directory | Remote directory for storing data and metadata objects. | |
| enable_tracing | Whether to enable distributed tracing. | false |
| max_concurrent_creating_streaming_jobs | Max number of concurrent creating streaming jobs. | 1 |
| minitrace | Whether to enable minitrace tracing. | false |
| minitrace_tiered_cache_read_ms | Threshold to record tiered cache read with minitrace. | 1000 |
| minitrace_tiered_cache_write_ms | Threshold to record tiered cache write with minitrace. | 1000 |
| parallel_compact_size_mb | The size of parallel task for one compact/flush job. | 512 |
| pause_on_next_bootstrap | Whether to pause all data sources on next bootstrap. | false |
| sstable_size_mb | Target size of the Sstable. | 256 |
Expand Down
3 changes: 3 additions & 0 deletions src/config/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,6 @@ bloom_false_positive = 0.001
max_concurrent_creating_streaming_jobs = 1
pause_on_next_bootstrap = false
enable_tracing = false
minitrace = false
minitrace_tiered_cache_read_ms = 1000
minitrace_tiered_cache_write_ms = 1000

0 comments on commit 53eab7f

Please sign in to comment.