Repository: jaygooby/ttfb.sh Branch: master Commit: e421d162074e Files: 8 Total size: 20.0 KB Directory structure: gitextract_dqqkb8n4/ ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── tests/ │ └── tests.bats └── ttfb ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ *.log ================================================ FILE: .travis.yml ================================================ language: bash before_install: - sudo apt-get update -qq - sudo apt-get install -qq bats script: - make ================================================ FILE: CONTRIBUTING.md ================================================ # Thanks for helping with ttfb! Tests live in the [`tests/tests.bats` file](tests/tests.bats) if you're adding a bugfix or making a small change, please ensure all tests pass. To run the tests, call `make` from the project root. You'll need to have [bats-core](https://github.com/bats-core/bats-core) installed and in your `$PATH`. If you only want to run a test or two, uncomment the `# skip` lines on the tests you don't care about, so they read `skip`, and then those tests will be skipped. If you're thinking about new functionality, check that it can't be achieved by passing `-o` options to curl; for instance, there's no need to raise a PR that makes `ttfb` ignore invalid certificates, you can achieve this by calling ttfb like `ttfb -o "-k" https://example.com` - the `-k` option is added to the `curl` call, and will therefore ignore invalid or expired certificates. If you do want to add new functionality, please also add a test to [`tests/tests.bats` file](tests/tests.bats). ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2019 Jay Caines-Gooby Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Makefile ================================================ default: test .PHONY: check-bats-exists check-bats-exists: @which bats > /dev/null || (echo "Missing dependency. You need to ensure that 'bats' is installed and in your \$$PATH. See https://github.com/bats-core/bats-core" && exit 1) .PHONY: test test: check-bats-exists bats tests/ ================================================ FILE: README.md ================================================ # Introduction Measures [time-to-first-byte](https://en.wikipedia.org/wiki/Time_to_first_byte) for single or multiple URLs. Can show you quickest, slowest & median TTFB values plus optionally log all response headers. [![Build Status](https://app.travis-ci.com/jaygooby/ttfb.sh.svg?branch=master)](https://app.travis-ci.com/jaygooby/ttfb.sh) ![Sample run of ttfb.sh](https://github.com/jaygooby/ttfb.sh/raw/readme-assets/demo.gif) ``` Usage: ttfb [options] url [url...] -d debug -l (infers -d) log response headers. Defaults to ./curl.log -n of times to test time to first byte -o