<commit_before>package main

import (
	"log"
	"math"
	"math/rand"
	"os"
	"os/signal"
	"syscall"
	"time"

	"github.com/PagerDuty/godspeed"
)

func main() {
	gs, _ := godspeed.NewDefault()
	gs.SetNamespace("statter")

	go histogram(gs)

	go timer(gs)
	go count(gs)
	go gauge(gs)
	go set(gs)
	waitForSignal()
}

func histogram(gs *godspeed.Godspeed) {
	for range time.NewTicker(time.Millisecond * 3).C {
		gs.Histogram("histogram", math.Sin(float64(time.Now().Unix())/math.Pi), nil)
	}
}

func count(gs *godspeed.Godspeed) {
	for range time.NewTicker(time.Millisecond * 5).C {
		gs.Count("count", math.Abs(math.Sin(float64(time.Now().Unix())/math.Pi))/1000, nil)
	}
}

func gauge(gs *godspeed.Godspeed) {
	val := 0.0
	for range time.NewTicker(time.Millisecond * 7).C {
		val += math.Abs(rand.NormFloat64()) / 1000
		gs.Gauge("gauge", val, nil)
	}
}

func set(gs *godspeed.Godspeed) {
	for range time.NewTicker(time.Millisecond).C {
		gs.Set("set", float64(rand.Intn(time.Now().Second()+1)), nil)
	}
}

func timer(gs *godspeed.Godspeed) {
	for range time.NewTicker(time.Millisecond * 3).C {
		gs.Timing("timer", math.Cos(float64(time.Now().Unix())/math.Pi), nil)
	}
}

func waitForSignal() {
	c := make(chan os.Signal)
	signal.Notify(c, os.Interrupt, os.Kill, syscall.SIGTERM)
	<-c
	log.Println("kill signal received")
}
<commit_msg>Pretty graphs for the Statter<commit_after>package main

import (
	"log"
	"math"
	"math/rand"
	"os"
	"os/signal"
	"syscall"
	"time"

	"github.com/PagerDuty/godspeed"
)

func main() {
	gs, _ := godspeed.NewDefault()
	gs.SetNamespace("statter")

	go histogram(gs)
	go timer(gs)
	go count(gs)
	go gauge(gs)
	go set(gs)

	waitForSignal()
}

func histogram(gs *godspeed.Godspeed) {
	for range time.NewTicker(time.Millisecond * 3).C {
		gs.Histogram("histogram", math.Sin(float64(time.Now().Unix())/math.Pi)+rand.Float64(), nil)
	}
}

func count(gs *godspeed.Godspeed) {
	for range time.NewTicker(time.Millisecond * 5).C {
		gs.Count("count", math.Abs(math.Sin(float64(time.Now().Unix())/math.Pi))/10, nil)
	}
}

func gauge(gs *godspeed.Godspeed) {
	for range time.NewTicker(time.Millisecond * 7).C {
		val := math.Sin(float64(time.Now().Unix())/10*math.Pi) + math.Cos(float64(time.Now().Second())/100*math.Pi)
		gs.Gauge("gauge", val, nil)
	}
}

func set(gs *godspeed.Godspeed) {
	for range time.NewTicker(time.Millisecond).C {
		gs.Set("set", float64(rand.Intn(time.Now().Second()+1)), nil)
	}
}

func timer(gs *godspeed.Godspeed) {
	for range time.NewTicker(time.Millisecond * 3).C {
		x := float64(time.Now().Unix()) / math.Pi
		gs.Timing(
			"timing",
			1+math.Min(
				math.Sin(x)+rand.Float64(),
				math.Cos(x)+rand.Float64(),
			),
			nil,
		)
	}
}

func waitForSignal() {
	c := make(chan os.Signal)
	signal.Notify(c, os.Interrupt, os.Kill, syscall.SIGTERM)
	<-c
	log.Println("kill signal received")
}

{'fraction_non_alphanumeric': 0.1908289241622575, 'fraction_numerical': 0.019753086419753086, 'mean_word_length': 4.2518518518518515, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4404247', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1174, 'n_words': 196}