<commit_before>/*
 * webtest
 * <NAME> <<EMAIL>>
 *
 * Periodically hit a URL and log the response time.
 */

package main

import (
	"log"
	"net/http"
	"time"
)

func TimeURL(url string) time.Duration {
	start := time.Now()
	http.Get(url)
	return time.Since(start)
}

func main() {
	log.Print(TimeURL("http://shee.sh/"))
}
<commit_msg>Added goroutine to perform fetching in a loop<commit_after>/*
 * webtest
 * <NAME> <<EMAIL>>
 *
 * Periodically hit a URL and log the response time.
 */

package main

import (
	"log"
	"net/http"
	"os"
	"time"
)

func TimeURL(url string) time.Duration {
	start := time.Now()
	http.Get(url)
	return time.Since(start)
}

func Fetcher(url string, frequency uint32, c chan<- time.Duration) {
	for {
		c <- TimeURL(url)
		time.Sleep(time.Duration(frequency) * time.Second)
	}
}

func main() {
	hostname, _ := os.Hostname()
	c := make(chan time.Duration)
	go Fetcher("http://shee.sh/", 10, c)
	for {
		log.Printf("%s %v", hostname, <-c)
	}
}

{'fraction_non_alphanumeric': 0.17078189300411523, 'fraction_numerical': 0.00411522633744856, 'mean_word_length': 3.568075117370892, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1504047', 'n_tokens_mistral': 395, 'n_tokens_neox': 385, 'n_words': 96}