Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/henrikig/weather-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/henrikig/weather-api

  • v0.0.0-20240201182143-06100d7b5d8b
  • Source
  • Go
  • Socket score

Version published
Created
Source

weather-api

A simple Go app for searching and displaying weather.

Usage

This project is most easily run with docker compose as it consists of a Go application and a database.

First, create a file called .env based on the values in template.env. Fill in relevant values.

Next, simply run the following command to build and run the app:

docker compose up --build

Now, visit localhost:8080 to test it out.

Benchmarking

For HTTP load testing, drill can be used. See their documentation for installation.

Once installed, simply run the following to see how the API responds to large numbers of concurrent requests:

drill --benchmark benchmark.yml --stats

This should generate a performance report something as follows:

Concurrency 20
Iterations 20
Rampup 0
Base URL http://localhost:8080

Fetch some cities from CSV http://localhost:8080/weather?city=Oslo 200 OK 136ms
Fetch some cities from CSV http://localhost:8080/weather?city=Oslo 200 OK 186ms
...

Fetch some cities from CSV Total requests            280
Fetch some cities from CSV Successful requests       280
Fetch some cities from CSV Failed requests           0
Fetch some cities from CSV Median time per request   143ms
Fetch some cities from CSV Average time per request  153ms
Fetch some cities from CSV Sample standard deviation 41ms
Fetch some cities from CSV 99.0th percentile        281ms
Fetch some cities from CSV 99.5th percentile        287ms
Fetch some cities from CSV 99.9th percentile        295ms

Time taken for tests      2.3 seconds
Total requests            280
Successful requests       280
Failed requests           0
Requests per second       122.21 [#/sec]
Median time per request   143ms
Average time per request  153ms
Sample standard deviation 41ms
99.0th percentile        281ms
99.5th percentile        287ms
99.9th percentile        295ms

FAQs

Package last updated on 01 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc