diff --git a/.ci/pr_lint.groovy b/.ci/pr_lint.groovy new file mode 100644 index 0000000..fad0271 --- /dev/null +++ b/.ci/pr_lint.groovy @@ -0,0 +1,34 @@ +@Library('pipelinex@development') _ + +podTemplate( + label: 'http-blaster-lint', + containers: [ + containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:4.0.1-1', workingDir: '/home/jenkins', resourceRequestCpu: '2000m', resourceLimitCpu: '2000m', resourceRequestMemory: '2048Mi', resourceLimitMemory: '2048Mi'), + containerTemplate(name: 'golang', image: 'golang:1.14.12', workingDir: '/home/jenkins', ttyEnabled: true, command: 'cat'), + containerTemplate(name: 'golangci-lint', image: 'golangci/golangci-lint:v1.32-alpine', workingDir: '/home/jenkins', ttyEnabled: true, command: 'cat'), + ], + envVars: [ + envVar(key: 'GO111MODULE', value: 'on'), + envVar(key: 'GOPROXY', value: 'https://goproxy.devops.iguazeng.com') + ], +) { + node("http-blaster-lint") { + common.notify_slack { + stage('Run golangci-lint') { + + container('golang') { + + checkout scm + sh "go mod download" + } + + container('golangci-lint') { + + ansiColor('xterm') { + sh "golangci-lint run -v" + } + } + } + } + } + } \ No newline at end of file diff --git a/.ci/release.groovy b/.ci/release.groovy new file mode 100644 index 0000000..977c358 --- /dev/null +++ b/.ci/release.groovy @@ -0,0 +1,37 @@ +@Library('pipelinex@development') _ + +podTemplate( + + label: 'http-blaster-release', + containers: [ + containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:4.0.1-1', workingDir: '/home/jenkins', resourceRequestCpu: '2000m', resourceLimitCpu: '2000m', resourceRequestMemory: '2048Mi', resourceLimitMemory: '2048Mi'), + containerTemplate(name: 'golang', image: 'golang:1.14.12', workingDir: '/home/jenkins', ttyEnabled: true, command: 'cat'), + ], +) { + node("http-blaster-release") { + common.notify_slack { + container('golang') { + + stage('Obtain sources') { + checkout scm + sh "curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR=/usr/local/bin/ sh" + } + + stage('Build and release binaries') { + + withCredentials([ + usernamePassword(credentialsId: 'iguazio-prod-artifactory-credentials', + usernameVariable: 'ARTIFACTORY_IGUAZIO_USERNAME', + passwordVariable: 'ARTIFACTORY_IGUAZIO_SECRET'), + usernamePassword(credentialsId: 'iguazio-prod-artifactory-credentials', + usernameVariable: 'ARTIFACTORY_NAIPI_USERNAME', + passwordVariable: 'ARTIFACTORY_NAIPI_SECRET'), + string(credentialsId: 'iguazio-prod-git-user-token', variable: 'GITHUB_TOKEN') + ]) { + sh "/usr/local/bin/goreleaser release" + } + } + } + } + } + } \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..e0b93de --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,74 @@ +project_name: http_blaster +env: + - GO111MODULE=on + - GOPROXY=goproxy.devops.iguazeng.com +before: + hooks: + - go mod download +builds: + - id: http_blaster + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + binary: http_blaster + ldflags: + - -s -w -X main.AppVersion={{ .Version }} + - id: http_blaster_latest + env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + binary: http_blaster + ldflags: + - -s -w -X main.AppVersion={{ .Version }} +archives: + - id: http_blaster + name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + format: binary + replacements: + amd64: x86_64 + builds: + - http_blaster + allow_different_binary_count: true + - id: http_blaster_latest + name_template: '{{ .ProjectName }}' + format: binary + builds: + - http_blaster_latest + allow_different_binary_count: true +release: + ids: + - http_blaster +artifactories: + - name: iguazio + target: https://artifactory.iguazeng.com/artifactory/iguazio_naipi/{{ .ProjectName }}/{{ .Version }}/ + mode: binary + checksum: true + ids: + - http_blaster + - name: naipi + target: https://artifactory.iguazeng.com/artifactory/iguazio_naipi/{{ .ProjectName }}/ + mode: binary + checksum: true + ids: + - http_blaster_latest +checksum: + name_template: 'checksums.txt' + algorithm: sha256 + disable: false +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + - Merge pull request + - Merge branch diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7cf3d0d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: go - -go: - - 1.12.x - - tip - -go_import_path: github.com/v3io/http_blaster -env: - global: - - VERSION=$(echo $TRAVIS_TAG) -before_deploy: - - "GOOS=linux GOARCH=amd64 go build -o http_blaster-${VERSION}-linux-amd64" - - "GOOS=darwin GOARCH=amd64 go build -o http_blaster-${VERSION}-darwin-amd64" -deploy: - provider: releases - api_key: - secure: STLU3YYuR/vuiYWciHPgR/+qCSmSFa41GVbgHDu6G/kD1S057l0xW3o6MejUcC6nMAQpaOcpfqju3X6vqqoIIPtLBjmJKgwsC57yi27GscJTCVHdWtDEzU5vRJ9L0zGKruETsJG+g4TL1dOELeluV/IF1xjoihLCy5Z65dVRfhpUhLfv/2eNkYr8KPqlr4vKTrSoXbigGsIL4Zjjrm/NWRf6ZKgVpoTjt510YyNcRp39MWXRyXZt+Yaj44lJ9i5zesfxDmchyhebQuQis7Eu2TQ24V65lGGhL2HDb7q2fn3AJl96F3xS/VFQnKmlPtaXSeZpCIy+UT4UQQptFGuUT+sK8tbDZ9qsBE4BS1zYtLOP/9fS2G4wkJRSMirXQbambnkrVrHEUl269P0DrdD8IuRTA7DCS7Nhn9EpEbnNVtJdVX0sr34ibJCjcay3JeewVktVoXuN9LkLnwWlfbs4/HAjRmoYGSUl2IFC7e8psr+NDPVgXYPrGhLYuqxqqEA62Rq1NzvjtgQjP+OQ+r0+R4K2TxhGJYDgS6sc37vFDF6+egF7wYmRy2oZGJAZ52PgpbCaAljk3+wH49COwgdhbiMXoiQiSkJm1WHEg8DhgRQPsaYxoMdRND/KNJromkbBsXYBY4b6DwB8ptzehdknJ1N/E1BdrlEXOUkYOZmnXvs= - file: - - "http_blaster-$VERSION-darwin-amd64" - - "http_blaster-$VERSION-linux-amd64" - skip_cleanup: true - on: - tags: true diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..4e80ef3 --- /dev/null +++ b/go.mod @@ -0,0 +1,27 @@ +module github.com/v3io/http_blaster + +go 1.12 + +replace github.com/v3io/v3io-tsdb => github.com/v3io/v3io-tsdb v0.11.6 + +require ( + github.com/BurntSushi/toml v0.3.1 + github.com/Gurpartap/logrus-stack v0.0.0-20170710170904-89c00d8a28f4 + github.com/MichaelSkralivetsky/termui v2.2.1-0.20200808100015-f72beafc9b23+incompatible + github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect + github.com/brianvoe/gofakeit v3.18.0+incompatible + github.com/buger/jsonparser v1.1.1 + github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect + github.com/go-ole/go-ole v1.2.5 // indirect + github.com/json-iterator/go v1.1.10 + github.com/mattn/go-runewidth v0.0.10 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/nsf/termbox-go v0.0.0-20201124104050-ed494de23a00 // indirect + github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d + github.com/sasile/gohistogram v1.0.1-0.20180425111433-5001302df51a + github.com/shirou/gopsutil v3.20.12+incompatible + github.com/sirupsen/logrus v1.7.0 + github.com/stretchr/testify v1.6.1 // indirect + github.com/v3io/v3io-tsdb v0.10.9 + github.com/valyala/fasthttp v1.19.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..52df4ea --- /dev/null +++ b/go.sum @@ -0,0 +1,158 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Gurpartap/logrus-stack v0.0.0-20170710170904-89c00d8a28f4 h1:vdT7QwBhJJEVNFMBNhRSFDRCB6O16T28VhvqRgqFyn8= +github.com/Gurpartap/logrus-stack v0.0.0-20170710170904-89c00d8a28f4/go.mod h1:SvXOG8ElV28oAiG9zv91SDe5+9PfIr7PPccpr8YyXNs= +github.com/MichaelSkralivetsky/termui v2.2.1-0.20200808100015-f72beafc9b23+incompatible h1:/E5ufOfeK6NSXgKAB6g/XEnW/FcN0+C+4YG/GR8X90Q= +github.com/MichaelSkralivetsky/termui v2.2.1-0.20200808100015-f72beafc9b23+incompatible/go.mod h1:O6lVSqqQRP6PFUNKhDehXnLpq9cM3yaEdEIHvshzabo= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4= +github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/brianvoe/gofakeit v3.18.0+incompatible h1:wDOmHc9DLG4nRjUVVaxA+CEglKOW72Y5+4WNxUIkjM8= +github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7WPaDzUjz+CZFqG+rPkOjGOc= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= +github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= +github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI= +github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.7 h1:7rix8v8GpI3ZBb0nSozFRgbtXKv+hOe+qfEpZqybrAg= +github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg= +github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= +github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/nsf/termbox-go v0.0.0-20201124104050-ed494de23a00 h1:Rl8NelBe+n7SuLbJyw13ho7CGWUt2BjGGKIoreCWQ/c= +github.com/nsf/termbox-go v0.0.0-20201124104050-ed494de23a00/go.mod h1:T0cTdVuOwf7pHQNtfhnEbzHbcNyCEcVU4YPpouCbVxo= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +github.com/nuclio/errors v0.0.1 h1:JoADBDnhRKjW05Npu5CLS27Peo7gx+QZcNrLwINV6UY= +github.com/nuclio/errors v0.0.1/go.mod h1:it2rUqDarIL8PasLYZo0Q1Ebsx4NRPM+OyYYakgNyrQ= +github.com/nuclio/logger v0.0.0-20190303161055-fc1e4b16d127/go.mod h1:ttazNAqTxKjQ7XrGDZxecumGa9KCIuJh88gzFY1mRXo= +github.com/nuclio/logger v0.0.1 h1:e+vT/Ug65RC+u0QX2J+lq3P57ZBwJ1ZA6Q2LCEcViwE= +github.com/nuclio/logger v0.0.1/go.mod h1:ttazNAqTxKjQ7XrGDZxecumGa9KCIuJh88gzFY1mRXo= +github.com/nuclio/nuclio-sdk-go v0.0.0-20190205170814-3b507fbd0324/go.mod h1:NqMgotiF6Y0Ho4+i5AvJhH3FRKAyL4IMaMv/eoUOkKQ= +github.com/nuclio/zap v0.0.2 h1:rY5PkMOl8CTkqRqIPuxziBiKK6Mq/8oEurfgRnNtqf0= +github.com/nuclio/zap v0.0.2/go.mod h1:SUxPsgePvlyjx6c5MtGdB50pf0IQThtlyLwISLboeuc= +github.com/pavius/zap v1.4.2-0.20180228181622-8d52692529b8 h1:WqLgmr/wj9TO5Sc6oYPQRAJBxuHE0NTeuVeFnT+FZVo= +github.com/pavius/zap v1.4.2-0.20180228181622-8d52692529b8/go.mod h1:6FWOCx06uh50GClv8S2cfk3asqTJs3qq3ZNRtLZE77I= +github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= +github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rs/xid v1.1.0/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/sasile/gohistogram v1.0.0 h1:vSRY29ZU0Us2mJJJOCxmmpwU1JfrYDDq00AjcwMzHhw= +github.com/sasile/gohistogram v1.0.0/go.mod h1:i7H6SKiUj0wNdaPiGKb3oVUcLu3X4L+2eHctglOuC1Y= +github.com/sasile/gohistogram v1.0.1-0.20180425111433-5001302df51a h1:oWWADuReCzBWnNGThpv+e5bjFvpikT/SiRtuipyN9nc= +github.com/sasile/gohistogram v1.0.1-0.20180425111433-5001302df51a/go.mod h1:i7H6SKiUj0wNdaPiGKb3oVUcLu3X4L+2eHctglOuC1Y= +github.com/shirou/gopsutil v3.20.12+incompatible h1:6VEGkOXP/eP4o2Ilk8cSsX0PhOEfX6leqAnD+urrp9M= +github.com/shirou/gopsutil v3.20.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tinylib/msgp v1.1.1 h1:TnCZ3FIuKeaIy+F45+Cnp+caqdXGy4z74HvwXN+570Y= +github.com/tinylib/msgp v1.1.1/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/v3io/frames v0.7.33/go.mod h1:pg88Tq3a9APkqyQXuUlGYgaBIAt4nn+dMDZATZJaaIo= +github.com/v3io/v3io-go v0.1.5-0.20200416113214-f1b82b9a8e82/go.mod h1:D0W1tjsVgcp4xk3ZI2fjKTKaOpYJLewN1BPN0x2osO4= +github.com/v3io/v3io-go v0.1.9 h1:etkrrRmrI++i8sxGfK/+13f41TxIMohYeZHwVUM62vw= +github.com/v3io/v3io-go v0.1.9/go.mod h1:5poBlcjZG5TiexRTYI44PE6tHzZz5Z60w+iS899pWtc= +github.com/v3io/v3io-tsdb v0.11.6 h1:G8Gn+RNEMS8zFLafoSaMzaCu65vJyJr/wx91a+g+KZ0= +github.com/v3io/v3io-tsdb v0.11.6/go.mod h1:uyk46LJxROChqmlhg5M5Kw7qK1WfJD3hrqNHR6kLjeg= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= +github.com/valyala/fasthttp v1.19.0 h1:PfTS4PeH3xDr3WomrDS2ID8lU2GskK1xS3YG6gIpibU= +github.com/valyala/fasthttp v1.19.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY= +go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0 h1:5kGOVHlq0euqwzgTC9Vu15p6fV1Wi0ArVi8da2urnVg= +golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +zombiezen.com/go/capnproto2 v2.17.0+incompatible h1:sIoKPFGNlM38Qh+PBLa9Wzg1j99oInS/Qlk+5N/CHa4= +zombiezen.com/go/capnproto2 v2.17.0+incompatible/go.mod h1:XO5Pr2SbXgqZwn0m0Ru54QBqpOf4K5AYBO+8LAOBQEQ= diff --git a/http_blaster.go b/http_blaster.go index ad7a762..4c0bd1a 100644 --- a/http_blaster.go +++ b/http_blaster.go @@ -22,20 +22,21 @@ package main import ( "flag" "fmt" - "github.com/Gurpartap/logrus-stack" - log "github.com/sirupsen/logrus" - "github.com/v3io/http_blaster/httpblaster" - "github.com/v3io/http_blaster/httpblaster/config" - "github.com/v3io/http_blaster/httpblaster/tui" "io" "math/rand" "os" "runtime/pprof" + "sort" "strings" "sync" "sync/atomic" "time" - "sort" + + logrus_stack "github.com/Gurpartap/logrus-stack" + log "github.com/sirupsen/logrus" + "github.com/v3io/http_blaster/httpblaster" + "github.com/v3io/http_blaster/httpblaster/config" + "github.com/v3io/http_blaster/httpblaster/tui" ) var ( @@ -61,40 +62,39 @@ var ( //LatencyCollectorGet histogram.LatencyHist// tui.LatencyCollector //LatencyCollectorPut histogram.LatencyHist//tui.LatencyCollector //StatusesCollector tui.StatusesCollector - term_ui *tui.Term_ui - dump_failures bool = true - dump_location string = "." - max_concurrent_workloads int = 1000 + term_ui *tui.Term_ui + dump_failures bool = true + dump_location string = "." + max_concurrent_workloads int = 1000 + AppVersion = "development" ) -const AppVersion = "3.0.10" - func init() { const ( - default_conf = "example.toml" - usage_conf = "conf file path" - usage_version = "show version" - default_showversion = false - usage_results_file = "results file path" - default_results_file = "example.results" - usage_log_file = "enable stdout to log" - default_log_file = true - default_worker_qd = 0 - usage_worker_qd = "queue depth for worker requests" - usage_verbose = "print debug logs" - default_verbose = false - usage_memprofile = "write mem profile to file" - default_memprofile = false - usage_cpuprofile = "write cpu profile to file" - default_cpuprofile = false - usage_enable_ui = "enable terminal ui" - default_enable_ui = false - usage_dump_failures = "enable 4xx status requests dump to file" - defaule_dump_failures = false - usage_dump_location = "location of dump requests" - default_dump_location = "." + default_conf = "example.toml" + usage_conf = "conf file path" + usage_version = "show version" + default_showversion = false + usage_results_file = "results file path" + default_results_file = "example.results" + usage_log_file = "enable stdout to log" + default_log_file = true + default_worker_qd = 0 + usage_worker_qd = "queue depth for worker requests" + usage_verbose = "print debug logs" + default_verbose = false + usage_memprofile = "write mem profile to file" + default_memprofile = false + usage_cpuprofile = "write cpu profile to file" + default_cpuprofile = false + usage_enable_ui = "enable terminal ui" + default_enable_ui = false + usage_dump_failures = "enable 4xx status requests dump to file" + defaule_dump_failures = false + usage_dump_location = "location of dump requests" + default_dump_location = "." default_max_concurrent_workloads = 1000 - usage_max_concurrent_workloads ="max concurrent workloads" + usage_max_concurrent_workloads = "max concurrent workloads" ) flag.StringVar(&conf_file, "conf", default_conf, usage_conf) flag.StringVar(&conf_file, "c", default_conf, usage_conf+" (shorthand)") @@ -201,7 +201,7 @@ func start_executors() { for i, e := range executors { ex_group.Add(1) e.Start(&ex_group) - if i > 0 && i % max_concurrent_workloads == 0{ + if i > 0 && i%max_concurrent_workloads == 0 { wait_for_completion() } } @@ -279,7 +279,7 @@ func report() int { } overall_requests += results.Total if executor.Workload.Type == "GET" { - overall_get_executors ++ + overall_get_executors++ overall_get_requests += results.Total overall_get_iops += results.Iops overall_get_avg_lat += results.Avg @@ -451,7 +451,7 @@ func enable_tui() chan struct{} { return nil } -func dump_latencies_histograms() ([]string, []float64, []string, []float64){ +func dump_latencies_histograms() ([]string, []float64, []string, []float64) { latency_get := make(map[int64]int) latency_put := make(map[int64]int) total_get := 0 @@ -471,7 +471,7 @@ func dump_latencies_histograms() ([]string, []float64, []string, []float64){ } } } - getKeys, getValues := dump_latency_histogram(latency_get, total_get, "GET") + getKeys, getValues := dump_latency_histogram(latency_get, total_get, "GET") putKeys, putValues := dump_latency_histogram(latency_put, total_put, "PUT") return getKeys, getValues, putKeys, putValues @@ -537,7 +537,6 @@ func dump_latency_histogram(histogram map[int64]int, total int, req_type string) return res_strings, res_values } - func main() { parse_cmd_line_args() load_test_Config() diff --git a/httpblaster/data_generator/fakerGenerator.go b/httpblaster/data_generator/fakerGenerator.go index dc13780..d7465fd 100644 --- a/httpblaster/data_generator/fakerGenerator.go +++ b/httpblaster/data_generator/fakerGenerator.go @@ -3,12 +3,13 @@ package data_generator import ( "crypto/rand" "encoding/base64" - "github.com/brianvoe/gofakeit" - log "github.com/sirupsen/logrus" - "github.com/v3io/http_blaster/httpblaster/igz_data" "math" "strconv" "time" + + "github.com/brianvoe/gofakeit" + log "github.com/sirupsen/logrus" + "github.com/v3io/http_blaster/httpblaster/igz_data" ) // Create structs with random injected data @@ -21,7 +22,7 @@ type Fake struct { BeerName string Color string Company string - CreditCardNumber string + CreditCardNumber int HackerPhrase string JobTitle string Password string @@ -57,7 +58,7 @@ func (self *Fake) GenerateRandomData(t time.Time) { self.BeerName = gofakeit.BeerName() // Duvel self.Color = gofakeit.Color() // MediumOrchid self.Company = gofakeit.Company() // Moen, Pagac and Wuckert - self.CreditCardNumber = gofakeit.CreditCardNumber(nil) // 4287271570245748 + self.CreditCardNumber = gofakeit.CreditCardNumber() // 4287271570245748 self.HackerPhrase = gofakeit.HackerPhrase() // Connecting the array won't do anything, we need to generate the haptic COM driver! self.JobTitle = gofakeit.JobTitle() // Director self.Password = gofakeit.Password(true, true, true, true, true, 32) // WV10MzLxq2DX79w1omH97_0ga59j8!kj diff --git a/pkg/mod/cache/lock b/pkg/mod/cache/lock new file mode 100644 index 0000000..e69de29