Skip to content

Commit

Permalink
Added field in collect data
Browse files Browse the repository at this point in the history
  • Loading branch information
kochetovd committed Aug 26, 2024
1 parent b3832f9 commit cda0e7e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 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.19.0"
ReleemAgentVersion = "1.19.1"
)

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.19.0
1.19.1
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.19.0
# install.sh - Version 1.19.1
# (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.19.0
install_script_version=1.19.1
logfile="releem-install.log"

WORKDIR="/opt/releem"
Expand Down
11 changes: 7 additions & 4 deletions metrics/dbCollectQueries.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,31 @@ func (DbCollectQueriesOptimization *DbCollectQueriesOptimization) GetMetrics(met
{
var output []MetricGroupValue
type information_schema_table_type struct {
TABLE_NAME string
TABLE_SCHEMA string
TABLE_NAME string
TABLE_TYPE string
ENGINE string
ROW_FORMAT string
TABLE_ROWS string
AVG_ROW_LENGTH string
MAX_DATA_LENGTH string
DATA_LENGTH string
INDEX_LENGTH string
TABLE_COLLATION string
}
var information_schema_table information_schema_table_type

rows, err := config.DB.Query("SELECT IFNULL(TABLE_NAME, 'NULL') as TABLE_NAME, IFNULL(TABLE_SCHEMA, 'NULL') as TABLE_SCHEMA, IFNULL(ENGINE, 'NULL') as ENGINE, IFNULL(TABLE_ROWS, 'NULL') as TABLE_ROWS, IFNULL(AVG_ROW_LENGTH, 'NULL') as AVG_ROW_LENGTH, IFNULL(DATA_LENGTH, 'NULL') as DATA_LENGTH, IFNULL(INDEX_LENGTH, 'NULL') as INDEX_LENGTH, IFNULL(TABLE_COLLATION, 'NULL') as TABLE_COLLATION FROM information_schema.tables")
rows, err := config.DB.Query("SELECT IFNULL(TABLE_SCHEMA, 'NULL') as TABLE_SCHEMA, IFNULL(TABLE_NAME, 'NULL') as TABLE_NAME, IFNULL(TABLE_TYPE, 'NULL') as TABLE_TYPE, IFNULL(ENGINE, 'NULL') as ENGINE, IFNULL(ROW_FORMAT, 'NULL') as ROW_FORMAT, IFNULL(TABLE_ROWS, 'NULL') as TABLE_ROWS, IFNULL(AVG_ROW_LENGTH, 'NULL') as AVG_ROW_LENGTH, IFNULL(MAX_DATA_LENGTH, 'NULL') as MAX_DATA_LENGTH,IFNULL(DATA_LENGTH, 'NULL') as DATA_LENGTH, IFNULL(INDEX_LENGTH, 'NULL') as INDEX_LENGTH, IFNULL(TABLE_COLLATION, 'NULL') as TABLE_COLLATION FROM information_schema.tables")
if err != nil {
DbCollectQueriesOptimization.logger.Error(err)
} else {
for rows.Next() {
err := rows.Scan(&information_schema_table.TABLE_NAME, &information_schema_table.TABLE_SCHEMA, &information_schema_table.ENGINE, &information_schema_table.TABLE_ROWS, &information_schema_table.AVG_ROW_LENGTH, &information_schema_table.DATA_LENGTH, &information_schema_table.INDEX_LENGTH, &information_schema_table.TABLE_COLLATION)
err := rows.Scan(&information_schema_table.TABLE_SCHEMA, &information_schema_table.TABLE_NAME, &information_schema_table.TABLE_TYPE, &information_schema_table.ENGINE, &information_schema_table.ROW_FORMAT, &information_schema_table.TABLE_ROWS, &information_schema_table.AVG_ROW_LENGTH, &information_schema_table.MAX_DATA_LENGTH, &information_schema_table.DATA_LENGTH, &information_schema_table.INDEX_LENGTH, &information_schema_table.TABLE_COLLATION)
if err != nil {
DbCollectQueriesOptimization.logger.Error(err)
return err
}
table := MetricGroupValue{"TABLE_NAME": information_schema_table.TABLE_NAME, "TABLE_SCHEMA": information_schema_table.TABLE_SCHEMA, "ENGINE": information_schema_table.ENGINE, "TABLE_ROWS": information_schema_table.TABLE_ROWS, "AVG_ROW_LENGTH": information_schema_table.AVG_ROW_LENGTH, "DATA_LENGTH": information_schema_table.DATA_LENGTH, "INDEX_LENGTH": information_schema_table.INDEX_LENGTH, "TABLE_COLLATION": information_schema_table.TABLE_COLLATION}
table := MetricGroupValue{"TABLE_SCHEMA": information_schema_table.TABLE_SCHEMA, "TABLE_NAME": information_schema_table.TABLE_NAME, "TABLE_TYPE": information_schema_table.TABLE_TYPE, "ENGINE": information_schema_table.ENGINE, "ROW_FORMAT": information_schema_table.ROW_FORMAT, "TABLE_ROWS": information_schema_table.TABLE_ROWS, "AVG_ROW_LENGTH": information_schema_table.AVG_ROW_LENGTH, "MAX_DATA_LENGTH": information_schema_table.MAX_DATA_LENGTH, "DATA_LENGTH": information_schema_table.DATA_LENGTH, "INDEX_LENGTH": information_schema_table.INDEX_LENGTH, "TABLE_COLLATION": information_schema_table.TABLE_COLLATION}
output = append(output, table)
}
}
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.19.0
# mysqlconfigurer.sh - Version 1.19.1
# (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.19.0"
VERSION="1.19.1"
RELEEM_INSTALL_PATH=$MYSQLCONFIGURER_PATH"install.sh"
logfile="releem-mysqlconfigurer.log"

Expand Down

0 comments on commit cda0e7e

Please sign in to comment.