<commit_before>package common

import (
	"sync"
)

const (
	EXCEPTION_NS = "collect.exception.loda"
	HOST_SUFFIX  = ""
)

const (
	TYPE_PROC     = "PROC"
	TYPE_PORT     = "PORT"
	TYPE_PLUGIN   = "PLUGIN"
	TYPE_LOG      = "LOG"
	TYPE_GOPLUGIN = "GOPLUGIN"

	TYPE_CPU  = "CPU"
	TYPE_DISK = "DISK"
	TYPE_MEM  = "MEM"
	TYPE_NET  = "NET"
	TYPE_FS   = "FS"
	TYPE_TIME = "TIME"
	TYPE_SYS  = "SYS"

	TYPE_COREDUMP = "COREDUMP"
)

var (
	DEFAULT_INTERVAL = map[string]int{
		TYPE_CPU:      10,
		TYPE_DISK:     10,
		TYPE_MEM:      10,
		TYPE_NET:      10,
		TYPE_PROC:     10,
		TYPE_PORT:     10,
		TYPE_FS:       300,
		TYPE_TIME:     300,
		TYPE_COREDUMP: 60,
	}

	SYS_TYPES = []string{TYPE_CPU, TYPE_DISK, TYPE_MEM, TYPE_NET, TYPE_COREDUMP, TYPE_FS, TYPE_TIME}
)

var (
	idLock = new(sync.RWMutex)
	UUID   []string

	nsLock     = new(sync.RWMutex)
	Namespaces = []string{}

	portsLock = new(sync.RWMutex)
	ports     = []PortMonitor{}

	procsLock = new(sync.RWMutex)
	procs     = []ProcMonitor{}

	pluginLock = new(sync.RWMutex)
	pluginInfo = map[string]bool{}
)

func SetUUID(ids []string) {
	idLock.Lock()
	UUID = ids
	idLock.Unlock()
}

func GetUUID() []string {
	idLock.Lock()
	defer idLock.Unlock()
	return UUID
}

func SetNamespaces(ns []string) {
	nsLock.Lock()
	defer nsLock.Unlock()
	Namespaces = ns
}

func GetNamespaces() []string {
	nsLock.Lock()
	defer nsLock.Unlock()
	return Namespaces
}

func SetPorts(newPorts []PortMonitor) {
	portsLock.Lock()
	defer portsLock.Unlock()
	ports = newPorts
}

func ReportPorts() []PortMonitor {
	portsLock.Lock()
	defer portsLock.Unlock()
	return ports
}

func SetProcs(newProcs []ProcMonitor) {
	procsLock.Lock()
	defer procsLock.Unlock()
	procs = newProcs
}

func ReportProcs() []ProcMonitor {
	procsLock.Lock()
	defer procsLock.Unlock()
	return procs
}

func SetPluginInfo(p map[string]bool) {
	pluginLock.Lock()
	defer pluginLock.Unlock()
	pluginInfo = p
}

func GetPluginInfo() map[string]bool {
	pluginLock.Lock()
	defer pluginLock.Unlock()
	return pluginInfo
}
<commit_msg>change proc/port collect interval<commit_after>package common

import (
	"sync"
)

const (
	EXCEPTION_NS = "collect.exception.loda"
	HOST_SUFFIX  = ""
)

const (
	TYPE_PROC     = "PROC"
	TYPE_PORT     = "PORT"
	TYPE_PLUGIN   = "PLUGIN"
	TYPE_LOG      = "LOG"
	TYPE_GOPLUGIN = "GOPLUGIN"

	TYPE_CPU  = "CPU"
	TYPE_DISK = "DISK"
	TYPE_MEM  = "MEM"
	TYPE_NET  = "NET"
	TYPE_FS   = "FS"
	TYPE_TIME = "TIME"
	TYPE_SYS  = "SYS"

	TYPE_COREDUMP = "COREDUMP"
)

var (
	DEFAULT_INTERVAL = map[string]int{
		TYPE_CPU:      10,
		TYPE_DISK:     10,
		TYPE_MEM:      10,
		TYPE_NET:      10,
		TYPE_PROC:     60,
		TYPE_PORT:     60,
		TYPE_FS:       300,
		TYPE_TIME:     300,
		TYPE_COREDUMP: 60,
	}

	SYS_TYPES = []string{TYPE_CPU, TYPE_DISK, TYPE_MEM, TYPE_NET, TYPE_COREDUMP, TYPE_FS, TYPE_TIME}
)

var (
	idLock = new(sync.RWMutex)
	UUID   []string

	nsLock     = new(sync.RWMutex)
	Namespaces = []string{}

	portsLock = new(sync.RWMutex)
	ports     = []PortMonitor{}

	procsLock = new(sync.RWMutex)
	procs     = []ProcMonitor{}

	pluginLock = new(sync.RWMutex)
	pluginInfo = map[string]bool{}
)

func SetUUID(ids []string) {
	idLock.Lock()
	UUID = ids
	idLock.Unlock()
}

func GetUUID() []string {
	idLock.Lock()
	defer idLock.Unlock()
	return UUID
}

func SetNamespaces(ns []string) {
	nsLock.Lock()
	defer nsLock.Unlock()
	Namespaces = ns
}

func GetNamespaces() []string {
	nsLock.Lock()
	defer nsLock.Unlock()
	return Namespaces
}

func SetPorts(newPorts []PortMonitor) {
	portsLock.Lock()
	defer portsLock.Unlock()
	ports = newPorts
}

func ReportPorts() []PortMonitor {
	portsLock.Lock()
	defer portsLock.Unlock()
	return ports
}

func SetProcs(newProcs []ProcMonitor) {
	procsLock.Lock()
	defer procsLock.Unlock()
	procs = newProcs
}

func ReportProcs() []ProcMonitor {
	procsLock.Lock()
	defer procsLock.Unlock()
	return procs
}

func SetPluginInfo(p map[string]bool) {
	pluginLock.Lock()
	defer pluginLock.Unlock()
	pluginInfo = p
}

func GetPluginInfo() map[string]bool {
	pluginLock.Lock()
	defer pluginLock.Unlock()
	return pluginInfo
}

{'fraction_non_alphanumeric': 0.12954768928220256, 'fraction_numerical': 0.00983284169124877, 'mean_word_length': 3.747957992998833, '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': '1158519', 'n_tokens_mistral': 1688, 'n_tokens_neox': 1659, 'n_words': 331}