PT-214 WIP

This commit is contained in:
Carlos Salguero
2017-12-13 16:35:59 -03:00
parent 0c5f329b86
commit 3d4c62da88
6 changed files with 244 additions and 105 deletions

135
Gopkg.lock generated Normal file
View File

@@ -0,0 +1,135 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/Masterminds/semver"
packages = ["."]
revision = "15d8430ab86497c5c0da827b748823945e1cf1e1"
version = "v1.4.0"
[[projects]]
branch = "master"
name = "github.com/StackExchange/wmi"
packages = ["."]
revision = "ea383cf3ba6ec950874b8486cd72356d007c768f"
[[projects]]
branch = "master"
name = "github.com/bradfitz/slice"
packages = ["."]
revision = "d9036e2120b5ddfa53f3ebccd618c4af275f47da"
[[projects]]
name = "github.com/go-ole/go-ole"
packages = [".","oleutil"]
revision = "0e87ea779d9deb219633b828a023b32e1244dd57"
version = "v1.2.0"
[[projects]]
name = "github.com/golang/mock"
packages = ["gomock"]
revision = "13f360950a79f5864a972c786a10a50e44b69541"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "github.com/hashicorp/go-version"
packages = ["."]
revision = "4fe82ae3040f80a03d04d2cccb5606a626b8e1ee"
[[projects]]
branch = "master"
name = "github.com/howeyc/gopass"
packages = ["."]
revision = "bf9dde6d0d2c004a008c27aaee91170c786f6db8"
[[projects]]
name = "github.com/montanaflynn/stats"
packages = ["."]
revision = "eeaced052adbcfeea372c749c281099ed7fdaa38"
version = "0.2.0"
[[projects]]
branch = "master"
name = "github.com/pborman/getopt"
packages = [".","v2"]
revision = "7148bc3a4c3008adfcab60cbebfd0576018f330b"
[[projects]]
name = "github.com/percona/pmgo"
packages = [".","pmgomock"]
revision = "9566dc76df319b856a12f24a3b6852a0c6463eff"
version = "0.5.1"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
name = "github.com/satori/go.uuid"
packages = ["."]
revision = "879c5887cd475cd7864858769793b2ceb0d44feb"
version = "v1.1.0"
[[projects]]
name = "github.com/shirou/gopsutil"
packages = ["cpu","host","internal/common","mem","net","process"]
revision = "bfe3c2e8f406bf352bc8df81f98c752224867349"
version = "v2.17.11"
[[projects]]
branch = "master"
name = "github.com/shirou/w32"
packages = ["."]
revision = "bb4de0191aa41b5507caa14b0650cdbddcd9280b"
[[projects]]
name = "github.com/sirupsen/logrus"
packages = ["."]
revision = "d682213848ed68c0a260ca37d6dd5ace8423f5ba"
version = "v1.0.4"
[[projects]]
branch = "master"
name = "go4.org"
packages = ["reflectutil"]
revision = "034d17a462f7b2dcd1a4a73553ec5357ff6e6c6e"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["ssh/terminal"]
revision = "94eea52f7b742c7cbe0b03b22f0c4c8631ece122"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = ["context"]
revision = "d866cfc389cec985d6fda2859936a575a55a3ab6"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix","windows"]
revision = "9418b3fdda89831e55f1d80702d6bf2f06d5438f"
[[projects]]
branch = "v2"
name = "gopkg.in/mgo.v2"
packages = [".","bson","dbtest","internal/json","internal/sasl","internal/scram"]
revision = "3f83fa5005286a7fe593b055f0d7771a7dce4655"
[[projects]]
branch = "v2"
name = "gopkg.in/tomb.v2"
packages = ["."]
revision = "d5d1b5820637886def9eef33e03a27a9f166942c"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "22594a7df9824c0a88d1de53c578d040b031dabd75d1fa852f7f775f4a71ae59"
solver-name = "gps-cdcl"
solver-version = 1

73
Gopkg.toml Normal file
View File

@@ -0,0 +1,73 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
[[constraint]]
name = "github.com/Masterminds/semver"
version = "1.4.0"
[[constraint]]
branch = "master"
name = "github.com/bradfitz/slice"
[[constraint]]
name = "github.com/golang/mock"
version = "1.0.0"
[[constraint]]
branch = "master"
name = "github.com/hashicorp/go-version"
[[constraint]]
branch = "master"
name = "github.com/howeyc/gopass"
[[constraint]]
name = "github.com/montanaflynn/stats"
version = "0.2.0"
[[constraint]]
branch = "master"
name = "github.com/pborman/getopt"
[[constraint]]
name = "github.com/percona/pmgo"
version = "0.5.1"
[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.0"
[[constraint]]
name = "github.com/satori/go.uuid"
version = "1.1.0"
[[constraint]]
name = "github.com/shirou/gopsutil"
version = "2.17.11"
[[constraint]]
name = "github.com/sirupsen/logrus"
version = "1.0.4"
[[constraint]]
branch = "v2"
name = "gopkg.in/mgo.v2"

View File

@@ -1978,6 +1978,31 @@ section_innodb () {
"$(get_var innodb_adaptive_checkpoint "$variables_file")"
}
section_rocksdb () {
local variables_file="$1"
local status_file="$2"
local NAME_VAL_LEN=25
[ -e "$variables_file" -a -e "$status_file" ] || return
name_val "Block Cache Size" "$(shorten $(get_var rocksdb_block_cache_size "$variables_file") 0)"
name_val "Max Total Wal Size" "$(shorten $(get_var rocksdb_max_total_wal_size "$variables_file") 0)"
name_val "Block Size" "$(shorten $(get_var rocksdb_block_size "$variables_file") 0)"
name_val "Max Open Files" "$(shorten $(get_var rocksdb_max_open_files "$variables_file") 0)"
name_val "Max Background Jobs" "$(shorten $(get_var rocksdb_max_background_jobs "$variables_file") 0)"
name_val "Table Cache NumHardBits" "$(shorten $(get_var rocksdb_table_cache_numshardbits "$variables_file") 0)"
name_val "Bytes Per Sync" "$(shorten $(get_var rocksdb_bytes_per_sync "$variables_file") 0)"
name_val "Wal Bytes per Sync" "$(shorten $(get_var rocksdb_wal_bytes_per_sync "$variables_file") 0)"
name_val "Rate Limiter Bytes Per Second" "$(shorten $(get_var rocksdb_rate_limiter_bytes_per_sec "$variables_file") 0)"
name_val "Compaction Seq Deletes Count SD" "$(shorten $(get_var rocksdb_compaction_sequential_deletes_count_sd "$variables_file") 0)"
name_val "Compaction Seq Deletes" "$(shorten $(get_var rocksdb_compaction_sequential_deletes "$variables_file") 0)"
name_val "Compaction Seq Deletes Window" "$(shorten $(get_var rocksdb_compaction_sequential_deletes_window "$variables_file") 0)"
}
section_noteworthy_variables () {
local file="$1"
@@ -2397,7 +2422,10 @@ report_mysql_summary () {
if [ -s "$dir/innodb-status" ]; then
format_innodb_status "$dir/innodb-status"
fi
fi
fi
section "RocksDB"
section_rocksdb "$dir/mysql-variables" "$dir/mysql-status"
section "MyISAM"
section_myisam "$dir/mysql-variables" "$dir/mysql-status"

78
glide.lock generated
View File

@@ -1,78 +0,0 @@
hash: 6d30e29455f610ee47cc43bafd9390da029e7fe8cf5dafe510e423e9c0e897a0
updated: 2017-08-31T20:21:56.600678687+02:00
imports:
- name: github.com/bradfitz/slice
version: d9036e2120b5ddfa53f3ebccd618c4af275f47da
- name: github.com/go-ole/go-ole
version: 02d3668a0cf01f58411cc85cd37c174c257ec7c2
subpackages:
- oleutil
- name: github.com/golang/mock
version: 93f6609a15b7de76bd49259f1f9a6b58df358936
subpackages:
- gomock
- name: github.com/hashicorp/go-version
version: 03c5bf6be031b6dd45afec16b1cf94fc8938bc77
- name: github.com/howeyc/gopass
version: bf9dde6d0d2c004a008c27aaee91170c786f6db8
- name: github.com/kr/pretty
version: cfb55aafdaf3ec08f0db22699ab822c50091b1c4
- name: github.com/Masterminds/semver
version: 517734cc7d6470c0d07130e40fd40bdeb9bcd3fd
- name: github.com/montanaflynn/stats
version: 41c34e4914ec3c05d485e564d9028d8861d5d9ad
- name: github.com/pborman/getopt
version: 7148bc3a4c3008adfcab60cbebfd0576018f330b
subpackages:
- v2
- name: github.com/percona/pmgo
version: 43e01b1a87fe20317bf4329d4ab3cb8d58d50886
subpackages:
- pmgomock
- name: github.com/pkg/errors
version: c605e284fe17294bda444b34710735b29d1a9d90
- name: github.com/satori/go.uuid
version: 5bf94b69c6b68ee1b541973bb8e1144db23a194b
- name: github.com/shirou/gopsutil
version: 09e98597147f04686f71603d5525627cd066701d
subpackages:
- cpu
- host
- internal/common
- mem
- net
- process
- name: github.com/shirou/w32
version: bb4de0191aa41b5507caa14b0650cdbddcd9280b
- name: github.com/sirupsen/logrus
version: 89742aefa4b206dcf400792f3bd35b542998eb3b
- name: github.com/StackExchange/wmi
version: ea383cf3ba6ec950874b8486cd72356d007c768f
- name: go4.org
version: 034d17a462f7b2dcd1a4a73553ec5357ff6e6c6e
subpackages:
- reflectutil
- name: golang.org/x/crypto
version: 3627ff35f31987174dbee61d9d1dcc1c643e7174
subpackages:
- ssh/terminal
- name: golang.org/x/net
version: 054b33e6527139ad5b1ec2f6232c3b175bd9a30c
subpackages:
- context
- name: golang.org/x/sys
version: abf9c25f54453410d0c6668e519582a9e1115027
subpackages:
- unix
- windows
- name: gopkg.in/mgo.v2
version: 3f83fa5005286a7fe593b055f0d7771a7dce4655
subpackages:
- bson
- dbtest
- internal/json
- internal/sasl
- internal/scram
- name: gopkg.in/tomb.v2
version: d5d1b5820637886def9eef33e03a27a9f166942c
testImports: []

View File

@@ -1,23 +0,0 @@
package: github.com/percona/percona-toolkit
import:
- package: github.com/bradfitz/slice
- package: github.com/hashicorp/go-version
- package: github.com/howeyc/gopass
- package: github.com/kr/pretty
- package: github.com/montanaflynn/stats
- package: github.com/pborman/getopt
- package: github.com/percona/pmgo
- package: github.com/pkg/errors
- package: github.com/satori/go.uuid
- package: github.com/shirou/gopsutil
subpackages:
- process
- package: github.com/sirupsen/logrus
- package: gopkg.in/mgo.v2
subpackages:
- bson
- package: github.com/Masterminds/semver
testImport:
- package: github.com/golang/mock
subpackages:
- gomock

View File

@@ -3,6 +3,7 @@ pkgs = $(shell find . -type d -name "pt-mongodb*" -exec basename {} \;)
VERSION="3.0.5"
BUILD=$(shell date +%FT%T%z)
GOVERSION=$(shell go version | cut --delimiter=" " -f3)
GOUTILSDIR ?= $(GOPATH)/bin
PREFIX=$(shell pwd)
TOP_DIR=$(shell git rev-parse --show-toplevel)
@@ -12,21 +13,24 @@ LDFLAGS="-X main.Version=${VERSION} -X main.Build=${BUILD} -X main.GoVersion=${G
.PHONY: all style format build test vet tarball linux-amd64
$(GOUTILSDIR)/dep:
go get -u github.com/golang/dep/cmd/dep
linux-amd64:
@echo "Building linux/amd64 binaries in ${BIN_DIR}"
@cd ${TOP_DIR} && glide update -v
@cd ${TOP_DIR} && dep ensure
@$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;)
@$(foreach pkg,$(pkgs),GOOS=linux GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);)
linux-386:
@echo "Building linux/386 binaries in ${BIN_DIR}"
@cd ${TOP_DIR} && glide update -v
@cd ${TOP_DIR} && dep ensure
@$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;)
@$(foreach pkg,$(pkgs),GOOS=linux GOARCH=386 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);)
darwin-amd64:
@echo "Building darwin/amd64 binaries in ${BIN_DIR}"
@cd ${TOP_DIR} && glide update -v
@cd ${TOP_DIR} && dep ensure
@$(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;)
@$(foreach pkg,$(pkgs),GOOS=darwin GOARCH=amd64 go build -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);)