<commit_before>#!/usr/bin/env python
#
# igcollect - Linux CPU performance factors
#
# Copyright (c) 2016, InnoGames GmbH
#

from __future__ import print_function
import socket, time, sys

factors = {
'Intel(R) Xeon(R) CPU           L5520  @ 2.27GHz':0.8,
'Intel(R) Xeon(R) CPU           L5640  @ 2.27GHz':1.0,
'Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz'	 :1.2,
'Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz'	 :1.44,
'Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz'	 :1.8
}
cpufactor = 1.0

try:
    cd = open('/proc/cpuinfo','r')
    cpu_data = cd.readlines(1024)
    cd.close()
except:
    sys.exit(1)

for line in cpu_data:
    l = line.split(':',1)[1].strip()
    if l in factors:
        cpufactor = factors[l]
        break

graphite_data=''
hostname = socket.gethostname().replace('.','_')
now = str(int(time.time()))
graphite_data += 'servers.%s.hardware.cpuinfo.perffactor %s %s\n' % (hostname, cpufactor,  now )
print(graphite_data)<commit_msg>added E5-2680 v4 CPUs perffactor<commit_after>#!/usr/bin/env python
#
# igcollect - Linux CPU performance factors
#
# Copyright (c) 2016, InnoGames GmbH
#

from __future__ import print_function
import socket, time, sys

factors = {
'Intel(R) Xeon(R) CPU           L5520  @ 2.27GHz':0.8,
'Intel(R) Xeon(R) CPU           L5640  @ 2.27GHz':1.0,
'Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz'	 :1.2,
'Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz'	 :1.44,
'Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz'	 :1.8,
'Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz'	 :1.8
}
cpufactor = 1.0

try:
    cd = open('/proc/cpuinfo','r')
    cpu_data = cd.readlines(1024)
    cd.close()
except:
    sys.exit(1)

for line in cpu_data:
    l = line.split(':',1)[1].strip()
    if l in factors:
        cpufactor = factors[l]
        break

graphite_data=''
hostname = socket.gethostname().replace('.','_')
now = str(int(time.time()))
graphite_data += 'servers.%s.hardware.cpuinfo.perffactor %s %s\n' % (hostname, cpufactor,  now )
print(graphite_data)
{'fraction_non_alphanumeric': 0.1739795918367347, 'fraction_numerical': 0.075, 'mean_word_length': 3.3577777777777778, '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': '1967503', 'n_tokens_mistral': 935, 'n_tokens_neox': 845, 'n_words': 186}