corrected indent
This commit is contained in:
14
collect.py
14
collect.py
@@ -19,6 +19,7 @@ def is_debian():
|
||||
# Debian-based systems often have 'debian' in their platform string
|
||||
return "linux" in platform.platform().lower()
|
||||
|
||||
|
||||
def getTimestamp():
|
||||
timestamp = time.time()
|
||||
local_time = time.localtime(timestamp)
|
||||
@@ -36,6 +37,7 @@ def runCollect(command):
|
||||
|
||||
return result.stderr
|
||||
|
||||
|
||||
def scaleIostat_disk():
|
||||
command = ["iostat", "-xyd", "1", "1"]
|
||||
filename = "ioStat.csv"
|
||||
@@ -115,12 +117,12 @@ def coreifstat():
|
||||
|
||||
lineData = lineData[:-2] + [0] + lineData[-2:]
|
||||
|
||||
if lineData:
|
||||
with open(filename, "a", newline="") as csvfile:
|
||||
csv_writer = csv.writer(csvfile)
|
||||
lineData.insert(0, "cpu")
|
||||
lineData.insert(0, getTimestamp())
|
||||
csv_writer.writerow(lineData)
|
||||
if lineData:
|
||||
with open(filename, "a", newline="") as csvfile:
|
||||
csv_writer = csv.writer(csvfile)
|
||||
lineData.insert(0, "cpu")
|
||||
lineData.insert(0, getTimestamp())
|
||||
csv_writer.writerow(lineData)
|
||||
|
||||
else:
|
||||
print(f"Error running command: {collect}")
|
||||
|
||||
Reference in New Issue
Block a user