Skip to content

Commit

Permalink
Change postgres_ndc to ndc_postgres in all metric names (#124)
Browse files Browse the repository at this point in the history
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

Our metrics had a mixture of names, this makes them consistent again.

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->
  • Loading branch information
danieljharvey committed Nov 1, 2023
1 parent a0a3248 commit 55ba5f9
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 53 deletions.
8 changes: 4 additions & 4 deletions benchmarks/component/metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ entire_address="http://${server_address}/metrics"
curl $entire_address > $directory/metrics.txt

REQUEST_TIME=$(cat $directory/metrics.txt \
| sed -n -e '/^postgres_ndc_query_total_time_sum/p' \
| sed -n -e '/^ndc_postgres_query_total_time_sum/p' \
| cut -d' ' -f2 )

CONNECTION_ACQUISITION_TIME=$(cat $directory/metrics.txt \
| sed -n -e '/^postgres_ndc_connection_acquisition_wait_time_sum/p' \
| sed -n -e '/^ndc_postgres_connection_acquisition_wait_time_sum/p' \
| cut -d' ' -f2 )

QUERY_TIME=$(cat $directory/metrics.txt \
| sed -n -e '/^postgres_ndc_query_execution_time_sum/p' \
| sed -n -e '/^ndc_postgres_query_execution_time_sum/p' \
| cut -d' ' -f2 )

REQUESTS_COUNT=$(cat $directory/metrics.txt \
| sed -n -e '/^postgres_ndc_query_total_time_count/p' \
| sed -n -e '/^ndc_postgres_query_total_time_count/p' \
| cut -d' ' -f2 )

REQUEST_TIME_MS=$(echo "scale=5;$REQUEST_TIME * 1000" | bc)
Expand Down
28 changes: 14 additions & 14 deletions crates/query-engine/execution/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,85 +29,85 @@ impl Metrics {
pub fn initialize(metrics_registry: &mut Registry) -> Result<Self, Error> {
let query_total = add_int_counter_metric(
metrics_registry,
"postgres_ndc_query_total",
"ndc_postgres_query_total",
"Total successful queries.",
)?;

let explain_total = add_int_counter_metric(
metrics_registry,
"postgres_ndc_explain_total",
"ndc_postgres_explain_total",
"Total successful explains.",
)?;

let query_total_time = add_histogram_metric(
metrics_registry,
"postgres_ndc_query_total_time",
"ndc_postgres_query_total_time",
"Total time taken to plan and execute a query, in seconds",
)?;

let query_plan_time = add_histogram_metric(
metrics_registry,
"postgres_ndc_query_plan_time",
"ndc_postgres_query_plan_time",
"Time taken to plan a query for execution, in seconds.",
)?;

let query_execution_time = add_histogram_metric(
metrics_registry,
"postgres_ndc_query_execution_time",
"ndc_postgres_query_execution_time",
"Time taken to execute an already-planned query, in seconds.",
)?;

let connection_acquisition_wait_time = add_histogram_metric(
metrics_registry,
"postgres_ndc_connection_acquisition_wait_time",
"ndc_postgres_connection_acquisition_wait_time",
"Time taken to acquire a connection.",
)?;

let pool_size = add_int_gauge_metric(
metrics_registry,
"postgres_ndc_pool_size",
"ndc_postgres_pool_size",
"The number of connections currently active. This includes idle connections.",
)?;

let pool_idle_count = add_int_gauge_metric(
metrics_registry,
"postgres_ndc_pool_idle",
"ndc_postgres_pool_idle",
"The number of connections active and idle (not in use).",
)?;

let pool_active_count = add_int_gauge_metric(
metrics_registry,
"postgres_ndc_pool_active",
"ndc_postgres_pool_active",
"The number of connections current active. This does not include idle connections.",
)?;

let pool_max_connections = add_int_gauge_metric(
metrics_registry,
"postgres_ndc_pool_max_connections",
"ndc_postgres_pool_max_connections",
"The maximum number of connections that this pool should maintain.",
)?;

let pool_min_connections = add_int_gauge_metric(
metrics_registry,
"postgres_ndc_pool_min_connections",
"ndc_postgres_pool_min_connections",
"The minimum number of connections that this pool should maintain.",
)?;

let pool_acquire_timeout = add_gauge_metric(
metrics_registry,
"postgres_ndc_pool_acquire_timeout",
"ndc_postgres_pool_acquire_timeout",
"Get the maximum amount of time to spend waiting for a connection, in seconds.",
)?;

let pool_idle_timeout = add_gauge_metric(
metrics_registry,
"postgres_ndc_pool_idle_timeout",
"ndc_postgres_pool_idle_timeout",
"Get the maximum idle duration for individual connections, in seconds.",
)?;

let pool_max_lifetime = add_gauge_metric(
metrics_registry,
"postgres_ndc_pool_max_lifetime",
"ndc_postgres_pool_max_lifetime",
"Get the maximum lifetime of individual connections, in seconds.",
)?;

Expand Down
Loading

1 comment on commit 55ba5f9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Component benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 55ba5f9 Previous: a0a3248 Ratio
select-where - request time - (query + acquisition) 12.377817925093467 ms 5.29662671875748 ms 2.34
select - request time - (query + acquisition) 29.96682637290546 ms 7.790179943490841 ms 3.85

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.