<commit_before># This is the default metric group, some of most common system metrics are
# defined here. This file is loaded by default. Metric functions should be
# simple and lightweight shell commands and under no circumstances they should
# fork backgroud processes or introduce delay. Metric names should be
# self-descriptive and should include its unit of measure when not clear by the
# name itself, Also they must start with "m_", though when referenced from the
# command line this part must be omitted.

m_read_b() { sed -n 's/^read_bytes: //p' /proc/$pid/io; }

m_write_b() { sed -n 's/^write_bytes: //p' /proc/$pid/io; }

m_buf_read_b() { sed -n 's/^rchar: //p' /proc/$pid/io; }

m_buf_write_b() { sed -n 's/^wchar: //p' /proc/$pid/io; }

m_core_count() { nproc; }

m_cpu_load_perc() { command ps -p $pid -o pcpu=; }

m_virt_mem_kb() { command ps -p $pid -o vsz=; }

m_res_mem_kb() { command ps -p $pid -o rss=; }

m_swap_mem_kb() { awk '/^Swap:/ {sum+=$2} END {print sum}' /proc/$pid/smaps; }

m_total_mem_kb() { awk '/^MemTotal:/ {print $2}' /proc/meminfo; }

m_free_mem_kb() { awk '/^MemFree:/ {print $2}' /proc/meminfo; }

m_total_swap_kb() { awk '/^SwapTotal:/ {print $2}' /proc/meminfo; }

m_free_swap_kb() { awk '/^SwapFree:/ {print $2}' /proc/meminfo; }

m_total_net_tx_b() { awk '/^.*:/ && $1 != "lo:" {sum+=$2} END {print sum}' /proc/net/dev; }

m_total_net_rx_b() { awk '/^.*:/ && $1 != "lo:" {sum+=$10} END {print sum}' /proc/net/dev; }<commit_msg>Add memory available default metric<commit_after># This is the default metric group, some of most common system metrics are
# defined here. This file is loaded by default. Metric functions should be
# simple and lightweight shell commands and under no circumstances they should
# fork backgroud processes or introduce delay. Metric names should be
# self-descriptive and should include its unit of measure when not clear by the
# name itself, Also they must start with "m_", though when referenced from the
# command line this part must be omitted.

m_read_b() { sed -n 's/^read_bytes: //p' /proc/$pid/io; }

m_write_b() { sed -n 's/^write_bytes: //p' /proc/$pid/io; }

m_buf_read_b() { sed -n 's/^rchar: //p' /proc/$pid/io; }

m_buf_write_b() { sed -n 's/^wchar: //p' /proc/$pid/io; }

m_core_count() { nproc; }

m_cpu_load_perc() { command ps -p $pid -o pcpu=; }

m_virt_mem_kb() { command ps -p $pid -o vsz=; }

m_res_mem_kb() { command ps -p $pid -o rss=; }

m_swap_mem_kb() { awk '/^Swap:/ {sum+=$2} END {print sum}' /proc/$pid/smaps; }

m_total_mem_kb() { awk '/^MemTotal:/ {print $2}' /proc/meminfo; }

m_available_mem_kb() { awk '/^MemAvailable:/ {print $2}' /proc/meminfo; }

m_free_mem_kb() { awk '/^MemFree:/ {print $2}' /proc/meminfo; }

m_total_swap_kb() { awk '/^SwapTotal:/ {print $2}' /proc/meminfo; }

m_free_swap_kb() { awk '/^SwapFree:/ {print $2}' /proc/meminfo; }

m_total_net_tx_b() { awk '/^.*:/ && $1 != "lo:" {sum+=$2} END {print sum}' /proc/net/dev; }

m_total_net_rx_b() { awk '/^.*:/ && $1 != "lo:" {sum+=$10} END {print sum}' /proc/net/dev; }
{'fraction_non_alphanumeric': 0.1812807881773399, 'fraction_numerical': 0.006896551724137931, 'mean_word_length': 3.8503184713375798, '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': '2436325', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1175, 'n_words': 364}