Skip to content
View LeojMarco's full-sized avatar

Block or report LeojMarco

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
LeojMarco/README.md

I'm- 👋 Hi, I’m @LeojMarco

  • 👀 I’m interested in ...
  • 🌱 I’m currently learning ...
  • 💞️ I’m looking to collaborate on ...
  • 📫 How to reach me ...
  • 😄 Pronouns: ...
  • ⚡ Fun fact: ...

#!/bin/bash

... (Copyright and License headers remain the same)

if [[ $UNDER_TEST_RUNNER -ne 1 ]]; then echo "This script should be run under run_integration_tests.sh" exit 1 fi

set -euo pipefail

log() { echo "[$(date)] $1"; }

Run bazel to populate some of the metrics.

log "Running Bazel test..." bazel --output_base="$BAZEL_CACHE_DIR" test --config self_test //:dummy_test

Fetch metrics (with error handling and logging)

log "Fetching metrics..." all_contents="$(curl --retry 5 --retry-delay 0 --retry-max-time 30 https://127.0.0.1:50061/metrics 2>&1)" || { log "Failed to fetch metrics: $all_contents" exit 1 }

echo "$all_contents"

... (Rest of the metric validations - with potential for more explicit checks and logging)

#!/bin/bash

... (Copyright and License headers remain the same)

if [[ $UNDER_TEST_RUNNER -ne 1 ]]; then echo "This script should be run under run_integration_tests.sh" exit 1 fi

set -euo pipefail

log() { echo "[$(date)] $1"; }

run_bazel_test() { log "Running Bazel test..." bazel --output_base="$BAZEL_CACHE_DIR" test --config self_test //:dummy_test }

fetch_metrics() { log "Fetching metrics..." local metrics_url="https://127.0.0.1:50061/metrics" all_contents="$(curl --retry 5 --retry-delay 0 --retry-max-time 30 "$metrics_url" 2>&1)" || { log "Failed to fetch metrics from $metrics_url: $all_contents" exit 1 } echo "$all_contents" }

check_metric() { local metric_name=$1 local expected_value=$2

log "Checking metric: $metric_name = $expected_value" if ! grep -q "$metric_name $expected_value" <<< "$all_contents"; then log "ERROR: Expected metric '$metric_name' to be '$expected_value' but not found in metrics." exit 1 fi }

Main script execution

run_bazel_test all_contents=$(fetch_metrics)

echo "$all_contents"

Static Metric Validations (with explicit checks and logging)

check_metric 'nativelink_stores_AC_MAIN_STORE_evicting_map_max_bytes' 500000000 check_metric 'nativelink_stores_AC_MAIN_STORE_read_buff_size_bytes' 32768

Uniqueness Check (with logging)

count=$(grep -c 'nativelink_stores_AC_MAIN_STORE_evicting_map_max_bytes 500000000' <<< "$all_contents") if [[ $count -ne 1 ]]; then log "ERROR: Expected 1 instance of CAS_MAIN_STORE, but found $count" exit 1 fi

Dynamic Metric Validations (with explicit checks and logging - adjust as needed)

check_metric 'nativelink_stores_AC_MAIN_STORE_evicting_map_item_size_bytes{quantile="0.99"}' '[0-9]+(.[0-9]+)?' # Check for a numeric value check_metric 'nativelink_stores_AC_MAIN_STORE_evicting_map_items_in_store_total' 3

log "All metric checks passed successfully."

Popular repositories Loading

  1. nativelink nativelink Public

    Forked from TraceMachina/nativelink

    NativeLink is an open source high-performance build cache and remote execution server, compatible with Bazel, Buck2, Reclient, and other RBE-compatible build systems. It offers drastically faster b…

    Rust 1

  2. jump jump Public

    Forked from a-scie/jump

    A Self Contained Interpreted Executable Launcher

    Rust

  3. LeojMarco LeojMarco Public

    Config files for my GitHub profile.

  4. Spoon-Knife Spoon-Knife Public

    Forked from octocat/Spoon-Knife

    This repo is for demonstration purposes only.

    HTML

  5. flake-parts flake-parts Public

    Forked from hercules-ci/flake-parts

    ❄️ Simplify Nix Flakes with the module system

    Nix