<commit_before>// +build linux

package procmon

import (
	"bufio"
	"fmt"
	log "github.com/Sirupsen/logrus"
	"io"
	"io/ioutil"
	"os"
	"strconv"
	"strings"
	"time"
)

func (m *Monitor) preflight() error {
	_, err := m.fetchProcessUsage()
	if err != nil {
		return err
	}
	_, err = m.fetchTotalUsage()
	if err != nil {
		return err
	}
	return nil
}

func parseProcStat(in io.Reader) (point, error) {
	// per proc(5) we are after fields utime and stime, numbers 14
	// and 15.
	contents, err := ioutil.ReadAll(in)
	if err != nil {
		return point{}, err
	}
	fields := strings.Split(string(contents), " ")
	if len(fields) < 15 {
		return point{}, fmt.Errorf("Not enough fields")
	}
	cutime, err := strconv.ParseUint(fields[13], 10, 64)
	if err != nil {<commit_msg>Lose unused import on Linux.<commit_after>// +build linux

package procmon

import (
	"bufio"
	"fmt"
	log "github.com/Sirupsen/logrus"
	"io"
	"io/ioutil"
	"os"
	"strconv"
	"strings"
)

func (m *Monitor) preflight() error {
	_, err := m.fetchProcessUsage()
	if err != nil {
		return err
	}
	_, err = m.fetchTotalUsage()
	if err != nil {
		return err
	}
	return nil
}

func parseProcStat(in io.Reader) (point, error) {
	// per proc(5) we are after fields utime and stime, numbers 14
	// and 15.
	contents, err := ioutil.ReadAll(in)
	if err != nil {
		return point{}, err
	}
	fields := strings.Split(string(contents), " ")
	if len(fields) < 15 {
		return point{}, fmt.Errorf("Not enough fields")
	}
	cutime, err := strconv.ParseUint(fields[13], 10, 64)
	if err != nil {
{'fraction_non_alphanumeric': 0.15672131147540982, 'fraction_numerical': 0.017049180327868854, 'mean_word_length': 3.514792899408284, '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': '1950994', 'n_tokens_mistral': 627, 'n_tokens_neox': 592, 'n_words': 167}