Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace mysql keywords/reserved words #14

Merged
merged 2 commits into from
May 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions db/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ CREATE TABLE `process`(
`version` VARCHAR(50) NOT NULL COMMENT 'xprofiler version',

-- cpu
`cpu_now` FLOAT(5,2) COMMENT 'current process cpu usage (0-100%)',
`cpu_15` FLOAT(5,2) COMMENT 'process cpu usage in last 15 sec (0-100%)',
`cpu_30` FLOAT(5,2) COMMENT 'process cpu usage in last 30 sec (0-100%)',
`cpu_60` FLOAT(5,2) COMMENT 'process cpu usage in last 60 sec (0-100%)',
`cpu_now` DECIMAL(5,2) COMMENT 'current process cpu usage (0-100%)',
`cpu_15` DECIMAL(5,2) COMMENT 'process cpu usage in last 15 sec (0-100%)',
`cpu_30` DECIMAL(5,2) COMMENT 'process cpu usage in last 30 sec (0-100%)',
`cpu_60` DECIMAL(5,2) COMMENT 'process cpu usage in last 60 sec (0-100%)',

-- memory
-- overview
Expand Down Expand Up @@ -98,7 +98,7 @@ CREATE TABLE `process`(
`http_response_sent` INT UNSIGNED COMMENT 'http responeses sent in last 1 min',
`http_request_timeout` INT UNSIGNED COMMENT 'timeout http requests in last 1 min',
`http_patch_timeout` INT UNSIGNED COMMENT 'http patch timeout (s)',
`http_rt` DOUBLE COMMENT 'http average response time (ms)',
`http_rt` DECIMAL(5,2) COMMENT 'http average response time (ms)',

`gm_modified` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'system modify timestamp',
`gm_create` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT 'system create timestamp',
Expand All @@ -118,17 +118,17 @@ CREATE TABLE `osinfo`(
`version` VARCHAR(50) DEFAULT '' COMMENT 'xprofiler version',

-- cpu
`used_cpu` DOUBLE COMMENT 'cpu usage (0-100%)',
`used_cpu` DECIMAL(5,2) COMMENT 'cpu usage (0-100%)',
`cpu_count` INT UNSIGNED COMMENT 'cpu count',

-- mem
`total_memory` BIGINT UNSIGNED COMMENT 'os total memory (byte)',
`free_memory` BIGINT UNSIGNED COMMENT 'os free memory (byte)',

-- load
`load1` DOUBLE COMMENT 'os load in last 1 min',
`load5` DOUBLE COMMENT 'os load in last 5 min',
`load15` DOUBLE COMMENT 'os load in last 15 min',
`load1` DECIMAL(5,2) COMMENT 'os load in last 1 min',
`load5` DECIMAL(5,2) COMMENT 'os load in last 5 min',
`load15` DECIMAL(5,2) COMMENT 'os load in last 15 min',

-- disks
`disks` VARCHAR(1024) COMMENT 'monitored disks directory and usage (0-100%)',
Expand All @@ -154,7 +154,7 @@ CREATE TABLE `osinfo`(
`http_response_sent` INT UNSIGNED COMMENT 'http responeses sent in last 1 min',
`http_request_timeout` INT UNSIGNED COMMENT 'timeout http requests in last 1 min',
`http_patch_timeout` INT UNSIGNED COMMENT 'http patch timeout (s)',
`http_rt` DOUBLE COMMENT 'http average response time (ms)',
`http_rt` DECIMAL(5,2) COMMENT 'http average response time (ms)',

`gm_modified` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'system modify timestamp',
`gm_create` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT 'system create timestamp',
Copy link
Member

Choose a reason for hiding this comment

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

DATETIME 其实也可以改为更加通用的 timestamp 类型

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个也不好说,我现在这家的dba要求我们用bigint 存

Expand Down