Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

Commit

Permalink
Upgrade JDBC driver and MySQL scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
VimukthiPerera authored and msmshariq committed Oct 25, 2018
1 parent f4e6a85 commit 6110f9a
Show file tree
Hide file tree
Showing 8 changed files with 561 additions and 1,196 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
WSO2_SERVER=wso2is-analytics
WSO2_SERVER_VERSION=5.7.0
WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}*.zip
MYSQL_CONNECTOR=mysql-connector-java-5.1.*-bin.jar
MYSQL_CONNECTOR=mysql-connector-*.jar
JDK_ARCHIVE=jdk-8u*-linux-x64.tar.gz
WORKING_DIRECTORY=/home/vagrant
JAVA_HOME=/opt/java/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
WSO2_SERVER=wso2is-analytics
WSO2_SERVER_VERSION=5.7.0
WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}*.zip
MYSQL_CONNECTOR=mysql-connector-java-5.1.*-bin.jar
MYSQL_CONNECTOR=mysql-connector-java-*.jar
JDK_ARCHIVE=jdk-8u*-linux-x64.tar.gz
WORKING_DIRECTORY=/home/vagrant
JAVA_HOME=/opt/java/
Expand Down
2 changes: 1 addition & 1 deletion identity-server/provisioner/product_provisioner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WSO2_SERVER=wso2is
WSO2_SERVER_VERSION=5.7.0
WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}*.zip
WSO2_SERVER_PACK=${WSO2_SERVER}-${WSO2_SERVER_VERSION}*.zip
MYSQL_CONNECTOR=mysql-connector-java-5.1.*-bin.jar
MYSQL_CONNECTOR=mysql-connector-java-*.jar
JDK_ARCHIVE=jdk-8u*-linux-x64.tar.gz
WORKING_DIRECTORY=/home/vagrant
JAVA_HOME=/opt/java/
Expand Down
5 changes: 3 additions & 2 deletions mysql/provisioner/db_provisioner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ WORKING_DIRECTORY=/home/vagrant

# run product db script
echo "Execute the database scripts..."
mysql -u${DB_USER} -p${DB_PASSWORD} -e "source ${WORKING_DIRECTORY}/mysql/scripts/mysql.sql"
mysql -u${DB_USER} -p${DB_PASSWORD} -e "source ${WORKING_DIRECTORY}/mysql/scripts/um_mysql.sql"
mysql -u${DB_USER} -p${DB_PASSWORD} -e "source ${WORKING_DIRECTORY}/mysql/scripts/mysql5.7.sql"
mysql -u${DB_USER} -p${DB_PASSWORD} -e "source ${WORKING_DIRECTORY}/mysql/scripts/um_mysql5.7.sql"
mysql -u${DB_USER} -p${DB_PASSWORD} -e "source ${WORKING_DIRECTORY}/mysql/scripts/analytics5.7.sql"
echo "Successfully executed the database scripts."

# grants root access to MySQL server from any host
Expand Down
86 changes: 86 additions & 0 deletions mysql/scripts/analytics5.7.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
DROP DATABASE IF EXISTS `wso2is_analytics`;
DROP DATABASE IF EXISTS `wso2carbon`;
DROP DATABASE IF EXISTS `wso2is_analytics_metrics`;

CREATE DATABASE `wso2is_analytics`;
CREATE DATABASE `wso2carbon`;
CREATE DATABASE `wso2is_analytics_metrics`;

USE `wso2is_analytics_metrics`;

CREATE TABLE IF NOT EXISTS METRIC_GAUGE (
ID BIGINT AUTO_INCREMENT PRIMARY KEY,
SOURCE VARCHAR(255) NOT NULL,
TIMESTAMP BIGINT NOT NULL,
NAME VARCHAR(255) NOT NULL,
VALUE VARCHAR(100) NOT NULL
);

CREATE TABLE IF NOT EXISTS METRIC_COUNTER (
ID BIGINT AUTO_INCREMENT PRIMARY KEY,
SOURCE VARCHAR(255) NOT NULL,
TIMESTAMP BIGINT NOT NULL,
NAME VARCHAR(255) NOT NULL,
COUNT BIGINT NOT NULL
);

CREATE TABLE IF NOT EXISTS METRIC_METER (
ID BIGINT AUTO_INCREMENT PRIMARY KEY,
SOURCE VARCHAR(255) NOT NULL,
TIMESTAMP BIGINT NOT NULL,
NAME VARCHAR(255) NOT NULL,
COUNT BIGINT NOT NULL,
MEAN_RATE DECIMAL NOT NULL,
M1_RATE DECIMAL NOT NULL,
M5_RATE DECIMAL NOT NULL,
M15_RATE DECIMAL NOT NULL,
RATE_UNIT VARCHAR(50) NOT NULL
);

CREATE TABLE IF NOT EXISTS METRIC_HISTOGRAM (
ID BIGINT AUTO_INCREMENT PRIMARY KEY,
SOURCE VARCHAR(255) NOT NULL,
TIMESTAMP BIGINT NOT NULL,
NAME VARCHAR(255) NOT NULL,
COUNT BIGINT NOT NULL,
MAX DECIMAL NOT NULL,
MEAN DECIMAL NOT NULL,
MIN DECIMAL NOT NULL,
STDDEV DECIMAL NOT NULL,
P50 DECIMAL NOT NULL,
P75 DECIMAL NOT NULL,
P95 DECIMAL NOT NULL,
P98 DECIMAL NOT NULL,
P99 DECIMAL NOT NULL,
P999 DECIMAL NOT NULL
);

CREATE TABLE IF NOT EXISTS METRIC_TIMER (
ID BIGINT AUTO_INCREMENT PRIMARY KEY,
SOURCE VARCHAR(255) NOT NULL,
TIMESTAMP BIGINT NOT NULL,
NAME VARCHAR(255) NOT NULL,
COUNT BIGINT NOT NULL,
MAX DECIMAL NOT NULL,
MEAN DECIMAL NOT NULL,
MIN DECIMAL NOT NULL,
STDDEV DECIMAL NOT NULL,
P50 DECIMAL NOT NULL,
P75 DECIMAL NOT NULL,
P95 DECIMAL NOT NULL,
P98 DECIMAL NOT NULL,
P99 DECIMAL NOT NULL,
P999 DECIMAL NOT NULL,
MEAN_RATE DECIMAL NOT NULL,
M1_RATE DECIMAL NOT NULL,
M5_RATE DECIMAL NOT NULL,
M15_RATE DECIMAL NOT NULL,
RATE_UNIT VARCHAR(50) NOT NULL,
DURATION_UNIT VARCHAR(50) NOT NULL
);

CREATE INDEX IDX_TIMESTAMP_GAUGE ON METRIC_GAUGE (TIMESTAMP);
CREATE INDEX IDX_TIMESTAMP_COUNTER ON METRIC_COUNTER (TIMESTAMP);
CREATE INDEX IDX_TIMESTAMP_METER ON METRIC_METER (TIMESTAMP);
CREATE INDEX IDX_TIMESTAMP_HISTOGRAM ON METRIC_HISTOGRAM (TIMESTAMP);
CREATE INDEX IDX_TIMESTAMP_TIMER ON METRIC_TIMER (TIMESTAMP);
Loading

0 comments on commit 6110f9a

Please sign in to comment.