couple changes for cleanup in perflogserver.py and daemon/setup.py
This commit is contained in:
parent
f66efd3ab9
commit
934d7a0764
2 changed files with 6 additions and 7 deletions
|
@ -14,14 +14,14 @@ _EXAMPLES_DIR = "share/core"
|
||||||
|
|
||||||
|
|
||||||
def recursive_files(data_path, files_path):
|
def recursive_files(data_path, files_path):
|
||||||
data_files = []
|
all_files = []
|
||||||
for path, directories, filenames in os.walk(files_path):
|
for path, _directories, filenames in os.walk(files_path):
|
||||||
directory = os.path.join(data_path, path)
|
directory = os.path.join(data_path, path)
|
||||||
files = []
|
files = []
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
files.append(os.path.join(path, filename))
|
files.append(os.path.join(path, filename))
|
||||||
data_files.append((directory, files))
|
all_files.append((directory, files))
|
||||||
return data_files
|
return all_files
|
||||||
|
|
||||||
|
|
||||||
def glob_files(glob_path):
|
def glob_files(glob_path):
|
||||||
|
|
|
@ -12,7 +12,6 @@ node metrics: throughput, mem, cpu total, usr, sys, wait
|
||||||
import commands
|
import commands
|
||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
import pdb
|
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
@ -116,8 +115,8 @@ def checkserverthreshold(metricval):
|
||||||
for key in serverthresholds.getkeys():
|
for key in serverthresholds.getkeys():
|
||||||
if key == "processorusedcputime":
|
if key == "processorusedcputime":
|
||||||
pcpus = metricval.getvalue(key)
|
pcpus = metricval.getvalue(key)
|
||||||
for ind in range(0, len(pcpus)):
|
for ind, pcpu in enumerate(pcpus):
|
||||||
if pcpus[ind] > serverthresholds.getvalue(key):
|
if pcpu > serverthresholds.getvalue(key):
|
||||||
alarm = ["server", os.uname()[1], str(ind) + key,
|
alarm = ["server", os.uname()[1], str(ind) + key,
|
||||||
"%.2f" % pcpus[ind], ">", serverthresholds.getvalue(key)]
|
"%.2f" % pcpus[ind], ">", serverthresholds.getvalue(key)]
|
||||||
if options.timestamp:
|
if options.timestamp:
|
||||||
|
|
Loading…
Reference in a new issue