break out relativeusage fun-ction

This commit is contained in:
rasmus 2020-12-22 00:41:31 +02:00
parent 9707368e3d
commit 035e575ddb
2 changed files with 8 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import logging
from time import sleep
# Local deps
import listServers
import listServers, relativeUsage
# Debugging stuffs
logging.basicConfig()
@ -105,10 +105,10 @@ channel.send('exit' + '\n') # Using lower level cmd since we're not going to get
ssh.close()
## Calculating blade usage by percentage. ##
# Keep in mind the querying of the data took a while, a minute or so.
relativeUsage.relativeUsage(encPowerUsageAC, servers)
print(servers)
breakpoint()
print()

5
relativeUsage.py Normal file
View File

@ -0,0 +1,5 @@
# Current data: [[1, 'tty-lab-1', '', 'OK', 'On', 'Off', 144], [2, 'tty-lab-2', 'CZ320263P9', 'OK', 'On', 'Off', 86], [3, 'tty-lab-3', 'CZJ14410KP', 'Failed', 'On', 'Off', 129], [4, 'kspve1', 'CZJ14410KK', 'OK', 'On', 'Off', 87], [5, 'kspve2-2', '', 'OK', 'On', 'Off', 87], [6, 'kspve3', '', 'OK', 'On', 'Off', 82], [7, 'plaes-blade', '', 'OK', 'On', 'Off', 81], [8, 'Ringly-01', 'CZ3402Y48C', 'OK', 'On', 'Off', 124], [9, 'toomas-lepik', 'CZ3217FNYE', 'OK', 'On', 'Off', 132], [10, 'toomas-lepik2', 'CZ3217FFSS', 'OK', 'On', 'Off', 101], [12, 'erki-naumanis', '', 'OK', 'On', 'Off', 88]]
def relativeUsage(encPowerUsageAC, servers):
return servers