diff --git a/.travis.yml b/.travis.yml index 021c409..86e4aa4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,9 +21,9 @@ script: - "$GOPATH/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_REPO_TOKEN" before_deploy: - - cd cmd/goexec - - GOOS=linux GOARCH=amd64 go build -o goexec_linux_amd64 - - GOOS=darwin GOARCH=amd64 go build -o goexec_darwin_amd64 + - cd cmd/fastexec + - GOOS=linux GOARCH=amd64 go build -o fastexec_linux_amd64 + - GOOS=darwin GOARCH=amd64 go build -o fastexec_darwin_amd64 deploy: skip_cleanup: true @@ -31,8 +31,8 @@ deploy: api_key: secure: 5Hc2R2hLP+aiTZF3zQGss//qdWoyevr/XFrNBfBv/Wj+WcOAtXPmY/MqAzt9Z8hV6BlWwXbGCNSGD57zjIQoXPlVZhmu+bEi1CaQ4pH5av3m4VBhOPZAaTIO9OWJuzxCGNwqQjrQnEJzWPt56ew81U1t1TjN0yXLaXB8wnvZcZ17BUkWGmp8FrOw3DkKwaS/lbaiAhF+3D/Nea0PDeWtDOIUoOTvXdMp8CSs+qpozGJRpvlD1LWFmQtMLvzVJ82h7RMn7ajeHVfX7FXrrgWl2gnsZ3MS3ivF8vvyggbOJdxl9zvlAUzkBwOAubcQCdOqMoXMZtATYiM3KEoCX6oCZtYtg+CM0EcvKaYz3DW4jIlTJ+e5fx10nYaEin/q+ryiZY61F8Pf1zthT+Pzu4Ew/aOCfxHq0wTDNs0PSE3F+VfbaU9P4Ei8DpamcV5QQFDQ3QHKpKBnXkifA5aMNScirUMD4/6T2/zpTxOsUUXjRA87W51uf7alr84k255XQNEy7L95toMTKmOSlY+aVs5CQjKtPKUcFWrtP2SDfi8v0aqxUEq4Lt3j1eC0NyTKhQjPAFCrkeDkRuqN2RwN6l8KFoMt7/kkHidV6YzQ0ZibKPeK3phJ6LlmV3E9OD1x87/KsL3KSNBtPJE+bhqhPQ1MSrAirL6uL32tEyhEJs3X5Lc= file: - - goexec_linux_amd64 - - goexec_darwin_amd64 + - fastexec_linux_amd64 + - fastexec_darwin_amd64 on: tags: true diff --git a/README.md b/README.md index eb813bd..12d091c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# fastexec +# Fastexec [![GoReportCard Widget]][GoReportCard] [![Travis Widget]][Travis] [![Coverage Status Widget]][Coverage Status] @@ -8,3 +8,56 @@ [Travis Widget]: https://travis-ci.org/unicell/fastexec.svg?branch=master [Coverage Status]: https://coveralls.io/github/unicell/fastexec [Coverage Status Widget]: https://coveralls.io/repos/github/unicell/fastexec/badge.svg + +
+ +### About + +Fastexec is a tool to parallelly run shell command on data subset. + +The idea is simple, fastexec takes data from standard input, divide it into +small chunks, pass it to workers running command line in parallel. And then it +will return the combined result from all workers. + +### Examples + +Run 1000 workers to curl URLs from the url_list.txt and output response code, +time cost for name resolution, connection and for entire request. + +```bash +cat url_list.txt | fastexec -workers 10000 xargs curl -sL \ +-w "%{http_code} %{time_namelookup} %{time_connect} %{time_total} %{url_effective}\\n" -o /dev/null +``` + +Parallelly run fping with 400 workers, and each takes 20 IPs from the +ip_list.txt. Fping will be triggered with `-t 1000` (1000 millisec timeout) and +all workers share the 1000 IP/s (1000 line of data / sec) rate limit. + +```bash +cat ip_list.txt | fastexec -chunks 20 -workers 400 -ratelimit 1000 fping -t 1000 +``` + +### Usage + +```bash + -alsologtostderr + log to standard error as well as files + -chunks int + size of data chunk for one job (default 1) + -log_backtrace_at value + when logging hits line file:N, emit a stack trace (default :0) + -log_dir string + If non-empty, write log files in this directory + -logtostderr + log to standard error instead of files + -ratelimit int + data processing ratelimit / sec (default -1) + -stderrthreshold value + logs at or above this threshold go to stderr + -v value + log level for V logs + -vmodule value + comma-separated list of pattern=N settings for file-filtered logging + -workers int + num of workers (default 1) +``` diff --git a/cmd/goexec/goexec.go b/cmd/fastexec/fastexec.go similarity index 100% rename from cmd/goexec/goexec.go rename to cmd/fastexec/fastexec.go