<commit_before># -*- coding: utf-8
#!/usr/bin/env python

import os
import sys
import re
import time
import socket
import getpass
import datetime
import platform
import base64, pickle

import urllib
import httplib
import subprocess


try:
    import json
except: pass



def _get_sys_loadavg():

    threshold_values = {
        "OK": {
            'range_min': 0,
            'range_max': 55,
        },
        "WARNING": {
            'range_min': 56,
            'range_max': 90,
            'duration_in_seconds': 'tbd',
        },
        "CRITICAL": {
            'range_min': 90,
            'duration_in_seconds': 'tbd',
        },
    }

    loadavg=subprocess.Popen(['uptime',], stdout=subprocess.PIPE, close_fds=True).communicate()[0]
    loadavg = re.findall(r"(\d+\.\d{2})", loadavg)

    # XXX nagios like message


    return loadavg
    

    

print _get_sys_loadavg()



<commit_msg>added on devel notes on the threshold definition devel<commit_after># -*- coding: utf-8
#!/usr/bin/env python

import os
import sys
import re
import time
import socket
import getpass
import datetime
import platform
import base64, pickle

import urllib
import httplib
import subprocess


try:
    import json
except: pass



def _get_sys_loadavg():

    threshold_values = {
        "OK": {
            'range_min': 0,
            'range_max': 55,
        },
        "WARNING": {
            'range_min': 56,
            'range_max': 90,
            'duration_in_seconds': 'tbd',
        },
        "CRITICAL": {
            'range_min': 90,
            'duration_in_seconds': 'tbd',
        },
    }

    loadavg=subprocess.Popen(['uptime',], stdout=subprocess.PIPE, close_fds=True).communicate()[0]
    loadavg = re.findall(r"(\d+\.\d{2})", loadavg)

    # XXX work nagios like output message


    return loadavg
    

    

print _get_sys_loadavg()




{'fraction_non_alphanumeric': 0.11954765751211632, 'fraction_numerical': 0.015078082929456112, 'mean_word_length': 2.2313043478260868, 'pattern_counts': {'":': 6, '<': 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': '642215', 'n_tokens_mistral': 647, 'n_tokens_neox': 603, 'n_words': 148}