| Conditions | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | # -*- coding: utf-8 -*- |
||
| 41 | def check(self): |
||
| 42 | """Return 1, 5 and 15 minute load averages from proc file loadavg. |
||
| 43 | |||
| 44 | :rtype: plumd.Result |
||
| 45 | """ |
||
| 46 | result = plumd.Result("loadavg") |
||
| 47 | dat = [] |
||
| 48 | # read and process /proc/stat |
||
| 49 | dat = get_file(self.proc_file).split() |
||
| 50 | if len(dat) >= 3: |
||
| 51 | result.add(plumd.Float("1", dat[0])) |
||
| 52 | result.add(plumd.Float("5", dat[1])) |
||
| 53 | result.add(plumd.Float("15", dat[2])) |
||
| 54 | return [result] |
||
| 55 |