Skip to content

Commit

Permalink
fixed error in scan sql query
Browse files Browse the repository at this point in the history
  • Loading branch information
kochetovd committed Jun 20, 2024
1 parent 758faba commit 845ce48
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

const (
ReleemAgentVersion = "1.17.1.1"
ReleemAgentVersion = "1.17.1.2"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion current_version_agent
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.17.1.1
1.17.1.2
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
# install.sh - Version 1.17.1.1
# install.sh - Version 1.17.1.2
# (C) Releem, Inc 2022
# All rights reserved

# Releem installation script: install and set up the Releem Agent on supported Linux distributions
# using the package manager.

set -e
install_script_version=1.17.1.1
install_script_version=1.17.1.2
logfile="releem-install.log"

WORKDIR="/opt/releem"
Expand Down
10 changes: 5 additions & 5 deletions metrics/dbCollectQueries.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (DbCollectQueries *DbCollectQueries) GetMetrics(metrics *Metrics) error {

{
var output []MetricGroupValue
var schema_name, query, query_text string
var schema_name, query, query_text, query_id string
var calls, avg_time_us, sum_time_us int

rows, err := DbCollectQueries.db.Query("SELECT IFNULL(schema_name, 'NULL') as schema_name, IFNULL(digest, 'NULL') as query_id, IFNULL(digest_text, 'NULL') as query, IFNULL(QUERY_SAMPLE_TEXT, 'NULL') as query_text, count_star as calls, round(avg_timer_wait/1000000, 0) as avg_time_us, round(SUM_TIMER_WAIT/1000000, 0) as sum_time_us FROM performance_schema.events_statements_summary_by_digest")
Expand All @@ -50,24 +50,24 @@ func (DbCollectQueries *DbCollectQueries) GetMetrics(metrics *Metrics) error {
}
} else {
for rows.Next() {
err := rows.Scan(&schema_name, &query, &calls, &avg_time_us, &sum_time_us)
err := rows.Scan(&schema_name, &query_id, &query, &calls, &avg_time_us, &sum_time_us)
if err != nil {
DbCollectQueries.logger.Error(err)
return err
}
digest := MetricGroupValue{"schema_name": schema_name, "query": query, "calls": calls, "avg_time_us": avg_time_us, "sum_time_us": sum_time_us}
digest := MetricGroupValue{"schema_name": schema_name, "query_id": query_id, "query": query, "calls": calls, "avg_time_us": avg_time_us, "sum_time_us": sum_time_us}
output = append(output, digest)
}
}

} else {
for rows.Next() {
err := rows.Scan(&schema_name, &query, &query_text, &calls, &avg_time_us, &sum_time_us)
err := rows.Scan(&schema_name, &query_id, &query, &query_text, &calls, &avg_time_us, &sum_time_us)
if err != nil {
DbCollectQueries.logger.Error(err)
return err
}
digest := MetricGroupValue{"schema_name": schema_name, "query": query, "query_text": query_text, "calls": calls, "avg_time_us": avg_time_us, "sum_time_us": sum_time_us}
digest := MetricGroupValue{"schema_name": schema_name, "query_id": query_id, "query": query, "query_text": query_text, "calls": calls, "avg_time_us": avg_time_us, "sum_time_us": sum_time_us}
output = append(output, digest)
}
}
Expand Down
4 changes: 2 additions & 2 deletions mysqlconfigurer.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# mysqlconfigurer.sh - Version 1.17.1.1
# mysqlconfigurer.sh - Version 1.17.1.2
# (C) Releem, Inc 2022
# All rights reserved

Expand All @@ -12,7 +12,7 @@ MYSQLTUNER_REPORT=$MYSQLCONFIGURER_PATH"mysqltunerreport.json"
RELEEM_MYSQL_VERSION=$MYSQLCONFIGURER_PATH"mysql_version"
MYSQLCONFIGURER_CONFIGFILE="${MYSQLCONFIGURER_PATH}${MYSQLCONFIGURER_FILE_NAME}"
MYSQL_MEMORY_LIMIT=0
VERSION="1.17.1.1"
VERSION="1.17.1.2"
RELEEM_INSTALL_PATH=$MYSQLCONFIGURER_PATH"install.sh"
logfile="releem-mysqlconfigurer.log"

Expand Down

0 comments on commit 845ce48

Please sign in to comment.