Code Monkey home page Code Monkey logo

loadlog's Introduction

loadlog

Log system-wide CPU temp and load, fan speed and memory usage. Uses Python 3 to record how running a particular program affects CPU temperature and load, fan speed, and overall memory usage. Any program that can be launched from the command line can be profiled by this script.

Test info

Tested on OS X 10.9.5, Python 3.4 by KK

Update

Tested on MacPro (Late 2013) by HY

  • OS version: maxOS High Sierra (10.13.6)
  • Python version: 3.7.5
  • Ruby version: 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin17]
  • iStats version: v1.6.1 installed via Gem (version 2.5.2.3)
  • psutil version: 5.6.7 installed via pip (version 19.3.1)

Requirements

  • istats : Ruby gem
    Command-line program that outputs overall CPU temperature and fan speed
    Install using command gem install iStats
    URL: https://github.com/Chris911/iStats

gem install iStats may not work simply and you may get an error message like,

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

In such case, use sudo gem install -n <dir under PATH> iStats. It will install iStats under the specified directory.

Usage

loadlog.py <"command"> [options]

How it works

This script records system stats before the target program is launched, while the target is running, and after a certain period of time after the program has finished.

To use this script, you must pass a command that you want to execute flanked by " ". Enter any command-line based command as you would type it in Terminal. You can also pass it optional arguments such as the computer name to be printed on the log file and the amount of time between recordings.

The script first instantiates a stats object and records system constants such as how many cpu cores are present and how much memory is installed. It also records load, temperature and fan speed before the command is executed (pre-run). After a certain amount of time (prewait), the script executes the command passed to it as a child process. While the program is running (child process is active), the script records cpu and memory load stats on a log file. After a predetermined amount time (postwait) after the command finishes executing, the script again records cpu and memory load of the post-run state.

loadlog's People

Contributors

kentwait avatar yamasampo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.