Skip to content

Commit

Permalink
perf: Prints only the last 100 lines of the logs
Browse files Browse the repository at this point in the history
  • Loading branch information
wangeguo committed Dec 28, 2023
1 parent a031d24 commit 29ea1c7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.6.12"
version = "0.6.13"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/amphitheatre-app/amphitheatre"
Expand Down
8 changes: 7 additions & 1 deletion apiserver/src/handlers/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ async fn log(
let sender = sender.clone();

tokio::spawn(async move {
let params = LogParams { container: Some(name.clone()), follow: true, timestamps: true, ..Default::default() };
let params = LogParams {
container: Some(name.clone()),
follow: true,
tail_lines: Some(100),
timestamps: true,
..Default::default()
};
let mut stream =
api.log_stream(&pod, &params).await.map_err(|e| ApiError::KubernetesError(e.to_string())).unwrap().lines();

Expand Down

0 comments on commit 29ea1c7

Please sign in to comment.