From dca525e98a414e9df9f315ae4c6f526dc44bf26f Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Fri, 28 Feb 2025 17:45:32 +0530 Subject: [PATCH] queries -> queryExecutions metric name Signed-off-by: Harshit Gangal --- changelog/22.0/22.0.0/summary.md | 6 +++--- go/test/endtoend/vtgate/misc_test.go | 6 +++--- go/vt/vtgate/executor.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/changelog/22.0/22.0.0/summary.md b/changelog/22.0/22.0.0/summary.md index 50214fa950e..171be636f3f 100644 --- a/changelog/22.0/22.0.0/summary.md +++ b/changelog/22.0/22.0.0/summary.md @@ -61,9 +61,9 @@ $ vtctldclient ApplySchema --ddl-strategy="pt-osc" ... #### New Metrics Added: Three new metrics have been introduced for queries: -1. `QueryProcessed` – Counts the number of queries executed. **Dimensions:** Query type, Plan type, Tablet type. +1. `QueryExecutions` – Counts the number of queries executed. **Dimensions:** Query type, Plan type, Tablet type. 2. `QueryRouted` – Counts the number of vttablets the query was executed on. **Dimensions:** Query type, Plan type, Tablet type. -3. `QueryTables` – Tracks queries processed at VTGate, with counts recorded per table. **Dimensions:** Query type, Table. +3. `QueryTables` – Tracks queries executed at VTGate, with counts recorded per table. **Dimensions:** Query type, Table. Example: ``` @@ -72,7 +72,7 @@ Shards: 2 Sharding Key: id for both tables Metrics Published: -1. QueryProcessed – {select, scatter, primary}, 1 +1. QueryExecutions – {select, scatter, primary}, 1 2. QueryRouted – {select, scatter, primary}, 2 3. QueryTables – {select, t1}, 1 and {select, t2}, 1 ``` diff --git a/go/test/endtoend/vtgate/misc_test.go b/go/test/endtoend/vtgate/misc_test.go index 09a6cbecbfb..f5745562a19 100644 --- a/go/test/endtoend/vtgate/misc_test.go +++ b/go/test/endtoend/vtgate/misc_test.go @@ -989,16 +989,16 @@ func TestQueryProcessedMetric(t *testing.T) { tableMetrics: []string{"SELECT.ks_t1", "SELECT.ks_t2", "SELECT.ks_t3", "SELECT.ks_t4"}, }} - initialQP := getQPMetric(t, "Queries") + initialQP := getQPMetric(t, "QueryExecutions") initialQR := getQPMetric(t, "QueryRoutes") initialQT := getQPMetric(t, "QueryTables") for _, tc := range tcases { t.Run(tc.sql, func(t *testing.T) { utils.Exec(t, conn, tc.sql) - updatedQP := getQPMetric(t, "Queries") + updatedQP := getQPMetric(t, "QueryExecutions") updatedQR := getQPMetric(t, "QueryRoutes") updatedQT := getQPMetric(t, "QueryTables") - assert.EqualValuesf(t, 1, getValue(updatedQP, tc.queryMetric)-getValue(initialQP, tc.queryMetric), "queries metric: %s", tc.queryMetric) + assert.EqualValuesf(t, 1, getValue(updatedQP, tc.queryMetric)-getValue(initialQP, tc.queryMetric), "queryExecutions metric: %s", tc.queryMetric) assert.EqualValuesf(t, tc.shards, getValue(updatedQR, tc.queryMetric)-getValue(initialQR, tc.queryMetric), "queryRoutes metric: %s", tc.queryMetric) for _, metric := range tc.tableMetrics { assert.EqualValuesf(t, 1, getValue(updatedQT, metric)-getValue(initialQT, metric), "queryTables metric: %s", metric) diff --git a/go/vt/vtgate/executor.go b/go/vt/vtgate/executor.go index a2f1ca4b49e..b836064535e 100644 --- a/go/vt/vtgate/executor.go +++ b/go/vt/vtgate/executor.go @@ -79,9 +79,9 @@ var ( queriesProcessedByTable = stats.NewCountersWithMultiLabels("QueriesProcessedByTable", "Deprecated: Queries processed at vtgate by plan type, keyspace and table", []string{"Plan", "Keyspace", "Table"}) queriesRoutedByTable = stats.NewCountersWithMultiLabels("QueriesRoutedByTable", "Deprecated: Queries routed from vtgate to vttablet by plan type, keyspace and table", []string{"Plan", "Keyspace", "Table"}) - queries = stats.NewCountersWithMultiLabels("Queries", "Counts queries processed at VTGate by query type, plan type, and tablet type.", []string{"Query", "Plan", "Tablet"}) + queries = stats.NewCountersWithMultiLabels("QueryExecutions", "Counts queries executed at at VTGate by query type, plan type, and tablet type.", []string{"Query", "Plan", "Tablet"}) queryRoutes = stats.NewCountersWithMultiLabels("QueryRoutes", "Counts queries routed from VTGate to VTTablet by query type, plan type, and tablet type.", []string{"Query", "Plan", "Tablet"}) - queriesByTable = stats.NewCountersWithMultiLabels("QueryTables", "Counts queries processed at VTGate per table by query type and table.", []string{"Query", "Table"}) + queriesByTable = stats.NewCountersWithMultiLabels("QueryTables", "Counts queries executed at VTGate per table by query type and table.", []string{"Query", "Table"}) // commitMode records the timing of the commit phase of a transaction. // It also tracks between different transaction mode i.e. Single, Multi and TwoPC