Advertisement
Guest User

loadavg computation

a guest
Jul 27th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. 119 def loadavg():
  2. 120 '''
  3. 121 Return the load averages for this minion
  4. 122
  5. 123 CLI Example::
  6. 124
  7. 125 salt '*' status.loadavg
  8. 126 '''
  9. 127 procf = '/proc/loadavg'
  10. 128 if not os.path.isfile(procf):
  11. 129 comps = "%.2f %.2f %.2f" % os.getloadavg()
  12. 130 else:
  13. 131 comps = salt.utils.fopen(procf, 'r').read().strip()
  14. 132 load_avg = comps.split()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement