<commit_before>from fabric.api import run

from cbagent.collectors.libstats.remotestats import (
    RemoteStats, multi_node_task)


class PSStats(RemoteStats):

    METRICS = (
        ("rss", 1024),    # kB -> B
        ("vsize", 1024),
    )

    def __init__(self, hosts, user, password):
        super(PSStats, self).__init__(hosts, user, password)
        self.ps_cmd = "ps -eo pid,rss,vsize,cmd | " \
                      "grep {} | grep -v grep | sort -n -k 2 | tail -n 1"<commit_msg>psstats: use `comm` instead of `cmd` field to prevent mis-identification of processes<commit_after>from fabric.api import run

from cbagent.collectors.libstats.remotestats import (
    RemoteStats, multi_node_task)


class PSStats(RemoteStats):

    METRICS = (
        ("rss", 1024),    # kB -> B
        ("vsize", 1024),
    )

    def __init__(self, hosts, user, password):
        super(PSStats, self).__init__(hosts, user, password)
        self.ps_cmd = "ps -eo pid,rss,vsize,comm | " \
                      "grep {} | grep -v grep | sort -n -k 2 | tail -n 1"
{'fraction_non_alphanumeric': 0.13031161473087818, 'fraction_numerical': 0.018885741265344664, 'mean_word_length': 2.4754098360655736, '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': '6186429', 'n_tokens_mistral': 381, 'n_tokens_neox': 346, 'n_words': 94}