Skip to content

Commit

Permalink
add compression layer
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Mar 8, 2024
1 parent 120475c commit 576d9c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ uuid = { version = "1", features = ["v4"] }

[target.'cfg(not(madsim))'.dependencies]
axum = "0.6"
tower-http = { version = "0.4", features = ["add-extension", "cors", "fs"] }
tower-http = { version = "0.4", features = [
"add-extension",
"cors",
"fs",
"compression-gzip",
] }
workspace-hack = { path = "../workspace-hack" }

[dev-dependencies]
Expand Down
6 changes: 4 additions & 2 deletions src/meta/src/dashboard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use risingwave_rpc_client::ComputeClientPool;
use thiserror_ext::AsReport;
use tower::{ServiceBuilder, ServiceExt};
use tower_http::add_extension::AddExtensionLayer;
use tower_http::compression::CompressionLayer;
use tower_http::cors::{self, CorsLayer};
use tower_http::services::ServeDir;

Expand Down Expand Up @@ -63,7 +64,7 @@ pub(super) mod handlers {
use risingwave_pb::catalog::table::TableType;
use risingwave_pb::catalog::{Sink, Source, Table, View};
use risingwave_pb::common::{WorkerNode, WorkerType};
use risingwave_pb::meta::{ActorLocation, PbTableFragments};
use risingwave_pb::meta::PbTableFragments;
use risingwave_pb::monitor_service::{
GetBackPressureResponse, HeapProfilingResponse, ListHeapProfilingResponse,
StackTraceResponse,
Expand Down Expand Up @@ -440,7 +441,8 @@ impl DashboardService {
let app = Router::new()
.fallback_service(dashboard_router)
.nest("/api", api_router)
.nest("/trace", trace_ui_router);
.nest("/trace", trace_ui_router)
.layer(CompressionLayer::new());

axum::Server::bind(&srv.dashboard_addr)
.serve(app.into_make_service())
Expand Down

0 comments on commit 576d9c0

Please sign in to comment.