<commit_before>package logmetrics

import (
	"fmt"
	"github.com/ActiveState/tail"
	"log"
	"path/filepath"
	"time"
)

type tailStats struct {
	line_read   int64
	byte_read   int64
	line_match  int64
	last_report time.Time
	hostname    string
	filename    string
	log_group   string
	interval    int
}

func (ts *tailStats) isTimeForStats() bool {
	return time.Now().Sub(ts.last_report) > time.Duration(ts.interval)*time.Second
}

func (ts *tailStats) incLineMatch() {
	ts.line_match++
}
<commit_msg>Switch to my fork of tail to limit the number of syscalls.<commit_after>package logmetrics

import (
	"fmt"
	"github.com/mathpl/tail"
	"log"
	"path/filepath"
	"time"
)

type tailStats struct {
	line_read   int64
	byte_read   int64
	line_match  int64
	last_report time.Time
	hostname    string
	filename    string
	log_group   string
	interval    int
}

func (ts *tailStats) isTimeForStats() bool {
	return time.Now().Sub(ts.last_report) > time.Duration(ts.interval)*time.Second
}

func (ts *tailStats) incLineMatch() {
	ts.line_match++
}

{'fraction_non_alphanumeric': 0.10328185328185328, 'fraction_numerical': 0.011583011583011582, 'mean_word_length': 4.058536585365854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4277157', 'n_tokens_mistral': 390, 'n_tokens_neox': 384, 'n_words': 91}