Skip to content

Commit

Permalink
use jemalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
DolceTriade committed Mar 17, 2024
1 parent 8731c58 commit 0b05b98
Show file tree
Hide file tree
Showing 9 changed files with 790 additions and 618 deletions.
1 change: 1 addition & 0 deletions blade/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ rust_binary(
"@crate//:log",
"@crate//:prometheus-client",
"@crate//:serde",
"@crate//:tikv-jemallocator",
"@crate//:time",
"@crate//:tokio",
"@crate//:tokio-stream",
Expand Down
4 changes: 4 additions & 0 deletions blade/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ cfg_if! {
use lazy_static::lazy_static;
use prometheus_client::metrics::family::Family;
use prometheus_client::metrics::counter::Counter;
use tikv_jemallocator::Jemalloc;

pub mod admin;

use crate::routes::app::App;

#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

lazy_static! {
static ref API_ERRORS: Family::<APIErrorLabels, Counter> = metrics::register_metric("blade_http_errors", "Actix API requests errors", Family::default());
static ref API_REQUESTS: Family::<APIRequestLabels, Counter> = metrics::register_metric("blade_http_requests", "Actix API requests", Family::default());
Expand Down
11 changes: 0 additions & 11 deletions blade/routes/app.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
use crate::components::nav::Nav;
use crate::routes::artifact::Artifact;
use crate::routes::details::Details;
use crate::routes::empty::Empty;
use crate::routes::invocation::Invocation;
use crate::routes::summary::Summary;
use crate::routes::test::Test;
use leptos::*;
use leptos_meta::*;
use leptos_router::*;
Expand All @@ -27,12 +22,6 @@ pub fn App() -> impl IntoView {
<Nav name="Blade" logo="/pkg/static/logo.svg"/>
<main>
<Routes>
<Route path="invocation/:id" view=Invocation>
<Route path="*any" view=Summary/>
<Route path="test" view=Test/>
<Route path="details" view=Details/>
<Route path="artifact" view=Artifact/>
</Route>
<Route path="*" view=Empty/>
</Routes>
</main>
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
diesel-cli'
wabt
postgresql
jemalloc
(import ./nix/cc/cc.nix)
]
++ pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.cctools;
Expand Down
1 change: 1 addition & 0 deletions nix/bazel/env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
findutils
gawk
gnugrep
gnumake
gnused
gnutar
gzip
Expand Down
Loading

0 comments on commit 0b05b98

Please sign in to comment.