From caca15d3b11d16c695cd40a1e4ba3e3fb410a400 Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 28 Mar 2024 18:31:28 +0900 Subject: [PATCH 1/5] CI --- .github/workflows/ci.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..8ec0fb3 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,22 @@ +name: CI + +on: + pull_request: + schedule: [ cron: "40 1 * * *" ] + +permissions: + contents: read + +env: + RUSTFLAGS: -Dwarnings + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: cargo fmt -- --check + - run: cargo build From b958b9dfc72c4a99c3ad00c4756bb14dc0dec998 Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 28 Mar 2024 18:33:16 +0900 Subject: [PATCH 2/5] format --- src/lambda_invoker.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lambda_invoker.rs b/src/lambda_invoker.rs index 1346543..4145464 100644 --- a/src/lambda_invoker.rs +++ b/src/lambda_invoker.rs @@ -110,12 +110,8 @@ impl LambdaInvoker { Some(last_update_status) => { info!("Checking if last update is successful: {last_update_status}"); match last_update_status { - LastUpdateStatus::Successful => { - Ok(true) - } - LastUpdateStatus::Failed | LastUpdateStatus::InProgress => { - Ok(false) - } + LastUpdateStatus::Successful => Ok(true), + LastUpdateStatus::Failed | LastUpdateStatus::InProgress => Ok(false), unknown => { warn!("LastUpdateStatus unknown: {unknown}"); Err(anyhow!("Unknown LastUpdateStatus, fn config is {config:?}")) From 316f055d5eba66210d00b8394be55febf9ba76bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TATSUNO=20=E2=80=9CTaz=E2=80=9D=20Yasuhiro?= Date: Thu, 21 Mar 2024 21:16:43 +0900 Subject: [PATCH 3/5] Add link to crates.io --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cb116f5..1bc949c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # cold-stat -![Crates.io Version](https://img.shields.io/crates/v/cold-stat) +[![Crates.io Version](https://img.shields.io/crates/v/cold-stat)](https://crates.io/crates/cold-stat) A CLI tool to statically analyze the initialization time, known as cold-start, of AWS Lambda functions. From ae179d4d750a9b760e66fbd5bc9a555744939da8 Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 28 Mar 2024 18:20:12 +0900 Subject: [PATCH 4/5] Increase iterations to u16(65535) since u8(255) is too small --- Cargo.toml | 2 +- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 856b25f..03961d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cold-stat" -version = "0.1.1" +version = "0.1.2" edition = "2021" authors = ["TATSUNO Yasuhiro "] license = "MIT" diff --git a/src/main.rs b/src/main.rs index 3502df1..830fea6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,7 +39,7 @@ struct Args { default_value_t = 100, help = "Number of iterations to invoke the function. It is recommended to set 30 at least. Because the number of collected cold starts often is a bit shorter than the specified `ITERATIONS` due to eventual consistency of CloudWatch Logs." )] - iterations: u8, + iterations: u16, #[arg( short, From 96e191a8f9693ce534062022102822272f3b299c Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 28 Mar 2024 18:36:37 +0900 Subject: [PATCH 5/5] fix type --- src/lambda_invoker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lambda_invoker.rs b/src/lambda_invoker.rs index 4145464..63709ea 100644 --- a/src/lambda_invoker.rs +++ b/src/lambda_invoker.rs @@ -23,7 +23,7 @@ impl LambdaInvoker { } } - pub async fn iterate(&self, iterations: u8) -> Result<(), anyhow::Error> { + pub async fn iterate(&self, iterations: u16) -> Result<(), anyhow::Error> { let config = self.get_function_configuration().await?; let mut env = config .environment