diff options
| author | MatthieuCoder <matthieu@matthieu-dev.xyz> | 2023-01-15 17:03:29 +0400 | 
|---|---|---|
| committer | MatthieuCoder <matthieu@matthieu-dev.xyz> | 2023-01-15 17:03:29 +0400 | 
| commit | cbcaa3c01ec4d9ed95dc5af8232de1d10191bc44 (patch) | |
| tree | 02cd56bb6eba762024c33f2df3cbec4f7a1a27e1 /exes/ratelimit | |
| parent | c06cf52e887cc560f1fd4fa72713b239fe0102a6 (diff) | |
add metrics and jemalloc
Diffstat (limited to 'exes/ratelimit')
| -rw-r--r-- | exes/ratelimit/Cargo.toml | 3 | ||||
| -rw-r--r-- | exes/ratelimit/src/main.rs | 7 | 
2 files changed, 10 insertions, 0 deletions
diff --git a/exes/ratelimit/Cargo.toml b/exes/ratelimit/Cargo.toml index 3989735..b011d38 100644 --- a/exes/ratelimit/Cargo.toml +++ b/exes/ratelimit/Cargo.toml @@ -39,3 +39,6 @@ test-log = { version = "0.2.11", features = ["log", "trace"] }  [[bench]]  name = "bucket"  harness = false + +[target.'cfg(not(target_env = "msvc"))'.dependencies] +tikv-jemallocator = "0.5"
\ No newline at end of file diff --git a/exes/ratelimit/src/main.rs b/exes/ratelimit/src/main.rs index 2de812b..d16e7d3 100644 --- a/exes/ratelimit/src/main.rs +++ b/exes/ratelimit/src/main.rs @@ -1,4 +1,11 @@  use leash::ignite;  use ratelimit::RatelimiterServerComponent; +#[cfg(not(target_env = "msvc"))] +use tikv_jemallocator::Jemalloc; + +#[cfg(not(target_env = "msvc"))] +#[global_allocator] +static GLOBAL: Jemalloc = Jemalloc; +  ignite!(RatelimiterServerComponent);  | 
