Skip to content

Commit

Permalink
Add RocksDB Table Reader Usage Metric
Browse files Browse the repository at this point in the history
The metric is called blaze_rocksdb_table_reader_usage_bytes.
  • Loading branch information
alexanderkiel committed May 29, 2023
1 parent 5c17c1b commit 2f41c3d
Show file tree
Hide file tree
Showing 19 changed files with 615 additions and 95 deletions.
20 changes: 20 additions & 0 deletions .github/scripts/test-metrics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -e

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
. "$SCRIPT_DIR/util.sh"

URL="http://localhost:8081/metrics"

num-metrics() {
NAME="$1"
FILTER="$2"
curl -s "$URL" | grep "$NAME" | grep -c "$FILTER"
}

test "blaze_rocksdb_block_cache_data_miss index" "$(num-metrics "blaze_rocksdb_block_cache_data_miss" "name=\"index\"")" "1"
test "blaze_rocksdb_block_cache_data_miss transaction" "$(num-metrics "blaze_rocksdb_block_cache_data_miss" "name=\"transaction\"")" "1"
test "blaze_rocksdb_block_cache_data_miss resource" "$(num-metrics "blaze_rocksdb_block_cache_data_miss" "name=\"resource\"")" "1"

test "blaze_rocksdb_table_reader_usage_bytes index" "$(num-metrics "blaze_rocksdb_table_reader_usage_bytes" "name=\"index\"")" "14"
test "blaze_rocksdb_table_reader_usage_bytes transaction" "$(num-metrics "blaze_rocksdb_table_reader_usage_bytes" "name=\"transaction\"")" "1"
test "blaze_rocksdb_table_reader_usage_bytes resource" "$(num-metrics "blaze_rocksdb_table_reader_usage_bytes" "name=\"resource\"")" "1"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ jobs:
run: curl -f --head http://localhost:8080/health

- name: Prometheus Metrics
run: curl -f http://localhost:8081/metrics
run: .github/scripts/test-metrics.sh

- name: Not Acceptable
run: .github/scripts/not-acceptable.sh
Expand Down
Loading

0 comments on commit 2f41c3d

Please sign in to comment.