<commit_before>package main

import (
	"log"
	"os"
	"runtime"
	"taskrunner-app/taskrunner-gtk/gui"
	"taskrunner-app/taskrunnerdal"
	"time"

	"github.com/alecthomas/kingpin"
	"github.com/mattn/go-gtk/gtk"

	"github.com/mattn/go-gtk/glib"

	"github.com/jamesrr39/goutil/user"
	"github.com/mattn/go-gtk/gdk"
)

var (
	taskrunnerDAL         *taskrunnerdal.TaskrunnerDAL
	taskrunnerApplication *kingpin.Application
	jobLogMaxLines        *uint
)

func main() {

	taskrunnerApplication = kingpin.New("Taskrunner GUI", "gtk gui for taskrunner")
	setupApplicationFlags()
	kingpin.MustParse(taskrunnerApplication.Parse(os.Args[1:]))

	go monitor()

	glib.ThreadInit(nil)
	gdk.ThreadsInit()
	gdk.ThreadsEnter()
	gtk.Init(nil)

	taskrunnerGUI := gui.NewTaskrunnerGUI(taskrunnerDAL, gui.TaskrunnerGUIOptions{*jobLogMaxLines})
	taskrunnerGUI.RenderScene(taskrunnerGUI.NewHomeScene())

	gtk.Main()
}

func setupApplicationFlags() {
	taskrunnerDir := taskrunnerApplication.
		Flag("taskrunner-dir", "Directory the taskruner uses to store job configs and logs of job runs.").
		Default("~/.local/share/github.com/jamesrr39/taskrunner-app").
		String()

	jobLogMaxLines = taskrunnerApplication.Flag("job-log-max-lines", "maximum number of lines to display in the job output. Lines after that are not shown in the UI, but the UI indicates where the whole log file is instead").
		Default("10000").
		Uint()

	taskrunnerApplication.Action(func(context *kingpin.ParseContext) error {
		expandedDir, err := user.ExpandUser(*taskrunnerDir)
		if nil != err {
			return err
		}

		taskrunnerDAL, err = taskrunnerdal.NewTaskrunnerDALAndEnsureDirectories(expandedDir)
		if nil != err {
			return err
		}

		return nil
	})
}

func monitor() {
	for {
		time.Sleep(time.Second)
		log.Printf("using %d goroutines\n", runtime.NumGoroutine())
	}
}
<commit_msg>make monitoring optional<commit_after>package main

import (
	"log"
	"os"
	"runtime"
	"taskrunner-app/taskrunner-gtk/gui"
	"taskrunner-app/taskrunnerdal"
	"time"

	"github.com/alecthomas/kingpin"
	"github.com/mattn/go-gtk/gtk"

	"github.com/mattn/go-gtk/glib"

	"github.com/jamesrr39/goutil/user"
	"github.com/mattn/go-gtk/gdk"
)

var (
	taskrunnerDAL         *taskrunnerdal.TaskrunnerDAL
	taskrunnerApplication *kingpin.Application
	jobLogMaxLines        *uint
	shouldMonitor         *bool
)

func main() {

	taskrunnerApplication = kingpin.New("Taskrunner GUI", "gtk gui for taskrunner")
	setupApplicationFlags()
	kingpin.MustParse(taskrunnerApplication.Parse(os.Args[1:]))

	if *shouldMonitor {
		go monitor()
	}

	glib.ThreadInit(nil)
	gdk.ThreadsInit()
	gdk.ThreadsEnter()
	gtk.Init(nil)

	taskrunnerGUI := gui.NewTaskrunnerGUI(taskrunnerDAL, gui.TaskrunnerGUIOptions{*jobLogMaxLines})
	taskrunnerGUI.RenderScene(taskrunnerGUI.NewHomeScene())

	gtk.Main()
}

func setupApplicationFlags() {
	taskrunnerDir := taskrunnerApplication.
		Flag("taskrunner-dir", "Directory the taskruner uses to store job configs and logs of job runs.").
		Default("~/.local/share/github.com/jamesrr39/taskrunner-app").
		String()

	shouldMonitor = taskrunnerApplication.Flag("monitor", "print information about the number of goroutines used to the log output").
		Bool()

	jobLogMaxLines = taskrunnerApplication.Flag("job-log-max-lines", "maximum number of lines to display in the job output. Lines after that are not shown in the UI, but the UI indicates where the whole log file is instead").
		Default("10000").
		Uint()

	taskrunnerApplication.Action(func(context *kingpin.ParseContext) error {
		expandedDir, err := user.ExpandUser(*taskrunnerDir)
		if nil != err {
			return err
		}

		taskrunnerDAL, err = taskrunnerdal.NewTaskrunnerDALAndEnsureDirectories(expandedDir)
		if nil != err {
			return err
		}

		return nil
	})
}

func monitor() {
	for {
		time.Sleep(time.Second)
		log.Printf("using %d goroutines (including 1 for monitoring).\n", runtime.NumGoroutine())
	}
}

{'fraction_non_alphanumeric': 0.12050359712230216, 'fraction_numerical': 0.00539568345323741, 'mean_word_length': 4.642028985507246, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2633417', 'n_tokens_mistral': 1432, 'n_tokens_neox': 1331, 'n_words': 277}