Creating a Simple Stress Test Tool in Go Part 3

Must accept a file arguement of urls to test For this feature I have added a file argument to the CLI configuration, with the value being passed to a new Application object. The CLI reposnsibility is to deal with the CLI context and not the logic of the application. RootCmd.PersistentFlags().StringVarP(&urlFile, "urls", "u", "", "The urls file to use") I have called the new struct Surge which will now be the main entry point of the actual application logic.

October 14, 2019

Enumerating Github Repositories in Bash

I needed to get a list of all the repositories for a specific Github Organisation. Github limits the page size which you have use which ruled out a single call with a large value. I was also writing this routine in bash and less is more as they say. My approach was very simplistic in that it simply tried an incrementing value for next page and if the response was empty then the end of the list had been reached.

August 19, 2019

Creating a Simple Stress Test Tool in Go Part 2

Must be a CLI I chose the Cobra https://github.com/spf13/cobra package for the CLI since it is used by a lot of popular applications and it made things a lot simpler than working with the raw command line arguments, including testing etc… In my opinion this is one of those decisions better made early so more focus can be given to the actual requirements. To get started I literally installed the generator and package with two separate go gets as per the documentation which created a default root command which I could build on.

June 10, 2019

Creating a Simple Stress Test Tool in Go Part 1

Must be continually built and published to github releases supporting Windows, Linux and Mac The first part is to create a new repository and setup the continuous integration environment which I will use github and circleci for respectively. I will name the repository and the project surge. https://github.com/reaandrew/surge.git To begin with I will create a simple hello world application to flush the pipeline with circleci. package main import "fmt" func main() { fmt.

June 9, 2019

Creating a Simple Stress Test Tool in Go - Requirements

One of the tools that has really stuck in my mind over the years is the siege stress test tool https://github.com/JoeDog/siege. It was really simple to use, give it a list of urls, add some command line arguments including concurrency, time etc… and it would begin testing those urls with really clear output. At the end of the test run it would print out statistics for the entire test like requests per second, average response time etc… One thing it also did was make a log of these statistics in tabular form in a file in the home directory which was really useful to compare performance against historical runs.

June 9, 2019

Getting back into blogging with Hugo!

This is a first blog post whilst I get this site back up and running using Hugo. The deployment option which I am using is the one where you use one github repository to store all the source and raw material and another github repository for the generated artefacts which are then published on github pages. There other ways of doing this (e.g. using a branch), which I tried, but I settled with the two repos approach.

June 8, 2019