https://github.com/nerdytechy/api-timer
GitHub Actions workflow for testing the response time of endpoints on an API.
https://github.com/nerdytechy/api-timer
action actions api api-test api-timer
Last synced: 11 months ago
JSON representation
GitHub Actions workflow for testing the response time of endpoints on an API.
- Host: GitHub
- URL: https://github.com/nerdytechy/api-timer
- Owner: NerdyTechy
- Created: 2023-01-04T18:45:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-10T22:38:12.000Z (11 months ago)
- Last Synced: 2025-05-11T09:07:39.955Z (11 months ago)
- Topics: action, actions, api, api-test, api-timer
- Language: JavaScript
- Homepage:
- Size: 645 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# API-Timer
GitHub Actions workflow for testing the response time of endpoints on an API.
## What does it do?
This workflow allows you to measure the response time of your API endpoints with custom parameters. This means that if you are hosting your API somewhere, you can have an actions workflow check your endpoints on push to ensure they respond within a set amount of time automatically, everytime you push new code. This endpoint can also serve the purpose of checking if your API is online by setting the time limit parameter to a high value, therefore giving the API lots of time to respond.
## Using this action
To use this action, create a YML file within the `.github/workflows` directory. This file can be named anything as long as it has the extention `.yml`, but we recommend calling it `api-timer.yml`.
Use the following snippet in the file to setup API-Timer, changing the values that have comments next to them as needed.
```yaml
name: "API Timer"
on:
push:
branches: [ "main" ] # The branches that will run this action when pushed to
jobs:
api-timer:
runs-on: ubuntu-latest
name: API Timer
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Run API Tests
uses: NerdyTechy/API-Timer@v1
with:
time-limit: 1000 # The amount of time endpoints must respond within before the test fails in ms
base: "https://api.example.com" # The base URL of your API
endpoints: "/endpoint1 /endpoint2 /endpoint3" # A space-separated list of endpoints on the base URL to test
```