From db4684ef6c57c4e14b5d0cb14b0906c412fb4542 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 3 Sep 2023 11:39:29 +0200 Subject: [PATCH] Add hyper-0.14.18 to metrics --- .github/workflows/metrics.yaml | 9 +++++++-- xtask/src/flags.rs | 3 +++ xtask/src/metrics.rs | 12 +++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/metrics.yaml b/.github/workflows/metrics.yaml index 214359e3c37..bbeccd1621d 100644 --- a/.github/workflows/metrics.yaml +++ b/.github/workflows/metrics.yaml @@ -67,7 +67,7 @@ jobs: other_metrics: strategy: matrix: - names: [self, ripgrep-13.0.0, webrender-2022, diesel-1.4.8] + names: [self, ripgrep-13.0.0, webrender-2022, diesel-1.4.8, hyper-0.14.18] runs-on: ubuntu-latest needs: [setup_cargo, build_metrics] @@ -133,10 +133,15 @@ jobs: with: name: diesel-1.4.8-${{ github.sha }} + - name: Download hyper-0.14.18 metrics + uses: actions/download-artifact@v3 + with: + name: hyper-0.14.18-${{ github.sha }} + - name: Combine json run: | git clone --depth 1 https://$METRICS_TOKEN@github.com/rust-analyzer/metrics.git - jq -s ".[0] * .[1] * .[2] * .[3] * .[4]" build.json self.json ripgrep-13.0.0.json webrender-2022.json diesel-1.4.8.json -c >> metrics/metrics.json + jq -s ".[0] * .[1] * .[2] * .[3] * .[4] * .[5]" build.json self.json ripgrep-13.0.0.json webrender-2022.json diesel-1.4.8.json hyper-0.14.18.json -c >> metrics/metrics.json cd metrics git add . git -c user.name=Bot -c user.email=dummy@example.com commit --message 📈 diff --git a/xtask/src/flags.rs b/xtask/src/flags.rs index af872facdf4..e52cbfca3e6 100644 --- a/xtask/src/flags.rs +++ b/xtask/src/flags.rs @@ -114,6 +114,7 @@ pub enum MeasurementType { AnalyzeRipgrep, AnalyzeWebRender, AnalyzeDiesel, + AnalyzeHyper, } impl FromStr for MeasurementType { @@ -125,6 +126,7 @@ fn from_str(s: &str) -> Result { "ripgrep-13.0.0" => Ok(Self::AnalyzeRipgrep), "webrender-2022" => Ok(Self::AnalyzeWebRender), "diesel-1.4.8" => Ok(Self::AnalyzeDiesel), + "hyper-0.14.18" => Ok(Self::AnalyzeHyper), _ => Err("Invalid option".to_string()), } } @@ -137,6 +139,7 @@ fn as_ref(&self) -> &str { Self::AnalyzeRipgrep => "ripgrep-13.0.0", Self::AnalyzeWebRender => "webrender-2022", Self::AnalyzeDiesel => "diesel-1.4.8", + Self::AnalyzeHyper => "hyper-0.14.18", } } } diff --git a/xtask/src/metrics.rs b/xtask/src/metrics.rs index ade2248776f..59d41d8e4b8 100644 --- a/xtask/src/metrics.rs +++ b/xtask/src/metrics.rs @@ -39,13 +39,10 @@ pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> { MeasurementType::AnalyzeSelf => { metrics.measure_analysis_stats_self(sh)?; } - MeasurementType::AnalyzeRipgrep => { - metrics.measure_analysis_stats(sh, name)?; - } - MeasurementType::AnalyzeWebRender => { - metrics.measure_analysis_stats(sh, name)?; - } - MeasurementType::AnalyzeDiesel => { + MeasurementType::AnalyzeRipgrep + | MeasurementType::AnalyzeWebRender + | MeasurementType::AnalyzeDiesel + | MeasurementType::AnalyzeHyper => { metrics.measure_analysis_stats(sh, name)?; } }; @@ -57,6 +54,7 @@ pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> { metrics.measure_analysis_stats(sh, MeasurementType::AnalyzeRipgrep.as_ref())?; metrics.measure_analysis_stats(sh, MeasurementType::AnalyzeWebRender.as_ref())?; metrics.measure_analysis_stats(sh, MeasurementType::AnalyzeDiesel.as_ref())?; + metrics.measure_analysis_stats(sh, MeasurementType::AnalyzeHyper.as_ref())?; "all" } };