<commit_before>package main

import (
	"log"
	"net"
	"sync"
	"sync/atomic"
	"time"
)

type ClientV2 struct {
	net.Conn
	sync.Mutex
	State            int
	ReadyCount       int64
	LastReadyCount   int64
	InFlightCount    int64
	MessageCount     uint64
	FinishCount      uint64
	RequeueCount     uint64
	ConnectTime      time.Time
	Channel          *Channel
	ReadyStateChange chan int
	ExitChan         chan int
	ShortIdentifier  string
	LongIdentifier   string
}

func NewClientV2(conn net.Conn) *ClientV2 {
	var identifier string
	if conn != nil {
		identifier = conn.RemoteAddr().String()
	}
	return &ClientV2{
		net.Conn:         conn,
		ReadyStateChange: make(chan int, 10),
		ExitChan:         make(chan int),
		ConnectTime:      time.Now(),
		ShortIdentifier:  identifier,
		LongIdentifier:   identifier,
	}
}

func (c *ClientV2) Stats() ClientStats {
	return ClientStats{
		version:       "V2",
		address:       c.RemoteAddr().String(),
		name:          c.ShortIdentifier,
		state:         c.State,
		readyCount:    atomic.LoadInt64(&c.ReadyCount),
		inFlightCount: atomic.LoadInt64(&c.InFlightCount),
		messageCount:  atomic.LoadUint64(&c.MessageCount),
		finishCount:   atomic.LoadUint64(&c.FinishCount),
		requeueCount:  atomic.LoadUint64(&c.RequeueCount),
		connectTime:   c.ConnectTime,
	}
}

func (c *ClientV2) IsReadyForMessages() bool {<commit_msg>default to just the hostname for backwards compatible identifier<commit_after>package main

import (
	"log"
	"net"
	"sync"
	"sync/atomic"
	"time"
)

type ClientV2 struct {
	net.Conn
	sync.Mutex
	State            int
	ReadyCount       int64
	LastReadyCount   int64
	InFlightCount    int64
	MessageCount     uint64
	FinishCount      uint64
	RequeueCount     uint64
	ConnectTime      time.Time
	Channel          *Channel
	ReadyStateChange chan int
	ExitChan         chan int
	ShortIdentifier  string
	LongIdentifier   string
}

func NewClientV2(conn net.Conn) *ClientV2 {
	var identifier string
	if conn != nil {
		identifier, _, _ = net.SplitHostPort(conn.RemoteAddr().String())
	}
	return &ClientV2{
		net.Conn:         conn,
		ReadyStateChange: make(chan int, 10),
		ExitChan:         make(chan int),
		ConnectTime:      time.Now(),
		ShortIdentifier:  identifier,
		LongIdentifier:   identifier,
	}
}

func (c *ClientV2) Stats() ClientStats {
	return ClientStats{
		version:       "V2",
		address:       c.RemoteAddr().String(),
		name:          c.ShortIdentifier,
		state:         c.State,
		readyCount:    atomic.LoadInt64(&c.ReadyCount),
		inFlightCount: atomic.LoadInt64(&c.InFlightCount),
		messageCount:  atomic.LoadUint64(&c.MessageCount),
		finishCount:   atomic.LoadUint64(&c.FinishCount),
		requeueCount:  atomic.LoadUint64(&c.RequeueCount),
		connectTime:   c.ConnectTime,
	}
}

func (c *ClientV2) IsReadyForMessages() bool {
{'fraction_non_alphanumeric': 0.09756969263759828, 'fraction_numerical': 0.02215868477483917, 'mean_word_length': 3.190119760479042, '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': '870304', 'n_tokens_mistral': 1005, 'n_tokens_neox': 928, 'n_words': 212}