Advertisement
emin_int11

snmp CPU ticks - network

Oct 2nd, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #emingh,#kafamiziyap
  2.  
  3. print "Processor clock ticks (idle processing) N*100"
  4. -- ssCpuRawUser
  5. The number of 'ticks' (typically 1/100s) spent
  6. processing user-level code.
  7.  
  8. On a multi-processor system, the 'ssCpuRaw*'
  9. counters are cumulative over all CPUs, so their
  10. sum will typically be N*100 (for N processors).
  11.  
  12.  
  13. cycle time = 1/clock rate = 1/3,000,000,000 * (n core) = 0.3 nanosecond (1 core)
  14.  
  15. secondary stage (network bandwith)
  16.  
  17. #1 megabit = 125 kilobyte
  18. #1 kilobit = 10^3 bits
  19.  
  20. inban=fetch("IF-MIB::ifHCInOctets")[actualethaddr]
  21. outban=fetch("IF-MIB::ifHCOutOctets")[actualethaddr]
  22. times=(0xf-0x9-0x1)
  23. time.sleep(times)
  24.  
  25. intwo=fetch("IF-MIB::ifHCInOctets")[actualethaddr]
  26. outtwo=fetch("IF-MIB::ifHCOutOctets")[actualethaddr]
  27.  
  28. ROOTOUT=(int(out2)-int(outban))
  29. ROOTIN=(int(in2)-int(inban))
  30.  
  31. inputbw=(((ROOTIN)/times)*8/1024)
  32. outputbw=(((ROOTOUT)/times)*8/1024)
  33.  
  34. inputbw indicates Input bandwith
  35. outputbw indicates Output bandwith
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement