<commit_before>package main

import (
	"github.com/alecthomas/kingpin"
	"github.com/elazarl/go-bindata-assetfs"
	"net/http"
)

//go:generate go-bindata -prefix "static/" -pkg main -o bindata.go static/index.html static/build/...
//go:generate cd static && echo "1"

var (
	host = kingpin.Flag("host", "database server host (default: localhost)").
		Short('h').PlaceHolder("HOSTNAME").Default("localhost").String()
	port = kingpin.Flag("port", "database server port (default: 5432)").
		Short('p').Default("5432").PlaceHolder("PORT").Int()
	username = kingpin.Flag("username", "").
			Short('U').Default("5432").PlaceHolder("USERNAME").String()
	database = kingpin.Arg("DBNAME", "").Required().String()
)

func main() {
	kingpin.Version("0.1.0")
	kingpin.Parse()
	var metrics = MetricList{}
	var connstring = connectionString(*host, *username)
	db, _ := connectDB(connstring)
	context := &appContext{db, &metrics}
	go metricScheduler(db, &metrics, indexBloatUpdate, 12*60*60, 120)
	go metricScheduler(db, &metrics, tableBloatUpdate, 12*60*60, 120)
	go metricScheduler(db, &metrics, databaseSizeUpdate, 60*60, 120)
	go metricScheduler(db, &metrics, numberOfConnectionUpdate, 5*60, 120)
	http.Handle("/api/stats", appHandler{context, metricsHandler})
	http.Handle("/",
		http.FileServer(
			&assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: ""}))
	http.ListenAndServe(":3000", nil)
}
<commit_msg>plug command line arg to control web port<commit_after>package main

import (
	"fmt"
	"github.com/alecthomas/kingpin"
	"github.com/elazarl/go-bindata-assetfs"
	"net/http"
)

//go:generate go-bindata -prefix "static/" -pkg main -o bindata.go static/index.html static/build/...

var (
	host = kingpin.Flag("host", "database server host (default: localhost)").
		Short('h').PlaceHolder("HOSTNAME").Default("localhost").String()
	port = kingpin.Flag("port", "database server port (default: 5432)").
		Short('p').Default("2345").PlaceHolder("PORT").Int()
	username = kingpin.Flag("username", "").
			Short('U').PlaceHolder("USERNAME").Required().String()
	database = kingpin.Arg("DBNAME", "").Required().String()
)

func main() {
	kingpin.Version("0.1.0")
	kingpin.Parse()
	var metrics = MetricList{}
	var connstring = connectionString(*host, *username)
	db, _ := connectDB(connstring)
	context := &appContext{db, &metrics}
	go metricScheduler(db, &metrics, indexBloatUpdate, 12*60*60, 120)
	go metricScheduler(db, &metrics, tableBloatUpdate, 12*60*60, 120)
	go metricScheduler(db, &metrics, databaseSizeUpdate, 60*60, 120)
	go metricScheduler(db, &metrics, numberOfConnectionUpdate, 5*60, 120)
	http.Handle("/api/stats", appHandler{context, metricsHandler})
	http.Handle("/",
		http.FileServer(
			&assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: ""}))
	http.ListenAndServe(fmt.Sprintf(":%d", *port), nil)
}

{'fraction_non_alphanumeric': 0.18217329545454544, 'fraction_numerical': 0.033025568181818184, 'mean_word_length': 5.771634615384615, 'pattern_counts': {'":': 2, '<': 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': '25578', 'n_tokens_mistral': 1052, 'n_tokens_neox': 967, 'n_words': 196}