Commit Graph

128 Commits

Author SHA1 Message Date
Pawel "l0ner" Soltys
2fb24571ef use inline function for unit conversion instead of macros 2015-01-18 20:02:46 +01:00
Pawel "l0ner" Soltys
7c883b924a restore parsing of /proc/meminfo to get memory usage
See issue:
e7f2dd25e8 (commitcomment-9327932)

Unfortunately we can't pull info about cached memory from sysinfo.
Thus we need stick to /proc/meminfo parsing. See code for more comments.
2015-01-18 19:20:55 +01:00
Pawel "l0ner" Soltys
ed8ed793bf renamed bsd/common.h to getsysctl.h to better reflect it's function 2015-01-18 17:27:08 +01:00
Pawel "l0ner" Soltys
a53bbddef8 added cmake generated config.h file to gitignore 2015-01-18 17:24:17 +01:00
Pawel "l0ner" Soltys
d3eb9e3187 use macros from config.h to calculate megabyes
instead of using hard coded divisions to calculate ram stats it's better to use
macros defined in config.h. BSD port was doing this already, using macros
defined in it's common.h header. I pulled those macros out and applied them to
all platforms.
File version.h.in got renamed into config.h.in since it doesn't caontain only
the version anymore.
2015-01-18 17:21:19 +01:00
Pawel "l0ner" Soltys
b2084ea3b3 better c++11 detection
2cc9efb187 (commitcomment-9327965)

Instead of checking for compiler version or whether it supports c++ features
through target_compile_features test whether compiler supports one of the c++11
flags (-std=c++11 or -std=c++0x). Cleaner and simplier code. And we can make it
fail loudly if comiler does not support c++11
2015-01-18 16:59:19 +01:00
Pawel "l0ner" Soltys
ae4e160ede added test case for graph_lines = 0 2015-01-18 15:07:11 +01:00
Pawel "l0ner" Soltys
89a4b0c048 version defines prefixed with name, full version
now the version variables will be prefixed with 'tmux-mem-cpu-load'. This way we
won't clash with any future dependency that might redefine those variables.
This is exactly how CMake does it in their code, see:

f3e92d2816/Source/CMakeVersion.cmake
6ae98ee18f/Source/cmVersionConfig.h.in
6ae98ee18f/Source/CMakeVersionCompute.cmake

the only difference is that they have functions that return the versions and I
use those variables directly.

6ae98ee18f/Source/cmVersion.cxx

Since the partial version variables are not used anywhere in the code we might
as well remove them from version.h.in. I've deciced to leave them for now, since
we might need them in the future.
2015-01-18 15:04:09 +01:00
Pawel "l0ner" Soltys
51f85ba032 code syntax style, vim modelines, license
* Use std::sting instead of char[] in the graph drawing functions. This is the
  only change to the code. Rest is just styling.
* Corrected whole code to follow Allman/GNU coding style, with 2 spaces for each
  indentation step.
* Added license headers to all code files
* Added vim modelines to all files. They sit on the first line and enable the
  following settings: 2 space indentation, tab expansion to spaces, line at
  80th column, automatic line breaking on "\ !@*+-;:,./?" characters, automatic
  line break if line exceeds 80 colums. This should keep the code nice and tidy.
2015-01-18 14:36:59 +01:00
Pawel "l0ner" Soltys
d5506ac797 added myself (l0ner) to contributors list 2015-01-18 14:30:38 +01:00
Pawel "l0ner" Soltys
3f4647a278 added AUTHORS file to store all contributors 2015-01-18 14:27:30 +01:00
Pawel "l0ner" Soltys
f2b75f7531 graph.cc: coding style fixes 2015-01-17 23:48:54 +01:00
Pawel "l0ner" Soltys
1cc6b0c9ef CMake style corrections 2015-01-17 23:23:21 +01:00
Pawel "l0ner" Soltys
5fdb0e6227 remove merge leftovers from README 2015-01-17 17:15:01 +01:00
Pawel "l0ner" Soltys
acaf9b0b2b fixed typo in CMakeLists.txt 2015-01-17 16:46:33 +01:00
Pawel "l0ner" Soltys
3475328dc4 added note to README about C++11 reqirement 2015-01-17 16:37:45 +01:00
Pawel "l0ner" Soltys
2cc9efb187 added compiler (and it's version) detection
This should fix problems with different flags for c++11 across different gcc
versions. Should compile on Clang and gcc >= 4.6. Lower versions of gcc are
untested. I don't even know wheteher they support c++11 (gcc 4.2.1 on OpenBSD
5.7 does not).
2015-01-17 16:30:31 +01:00
Pawel "l0ner" Soltys
7151b70c70 Fixed typos in linux/load.cc 2015-01-17 16:23:55 +01:00
Pawel "l0ner" Soltys
ee39fccc65 Merge remote-tracking branch 'upstream/master'
Conflicts:
	CMakeLists.txt
	README.rst
	tmux-mem-cpu-load.cpp
2015-01-17 16:21:56 +01:00
Pawel "l0ner" Soltys
d692eeaf93 added missing include "load.h" 2015-01-12 15:58:31 +01:00
Pawel "l0ner" Soltys
f073450edd OSX: removed useless includes 2015-01-12 15:57:41 +01:00
Pawel "l0ner" Soltys
8264c6e2a2 drop OpenBSD support. See bsd/openBSD.txt for info 2015-01-12 15:21:43 +01:00
Pawel "l0ner" Soltys
a2df46dae5 colorized output on *BSD systems 2015-01-11 18:27:08 +01:00
Pawel "l0ner" Soltys
e8dd4b442f fixed functions headers to account for use_colors 2015-01-11 18:05:08 +01:00
Pawel "l0ner" Soltys
a2e8459457 fixed uncorrect ram usage
While (as per specification) size of total ram reported by sysctl should be
64 bits it's actually 32.
2015-01-11 18:03:22 +01:00
Pawel "l0ner" Soltys
df5d66fdbf fixed incorrect cpu usage
While (as for manual) correct size of cpu states variable sould be 64 bits,
the systctl actually return 32 bits for kern.cp_time.
2015-01-11 18:01:13 +01:00
Pawel "l0ner" Soltys
dba56f1b56 Merge branch 'l0ner' of github.com:l0ner/tmux-mem-cpu-load into l0ner 2015-01-10 18:39:45 +01:00
Pawel "l0ner" Soltys
f59b11971f *BDS port:
- split *BDS files
- add CMake confingure instructions on bsd systems
- add includes to main file
2015-01-10 18:34:37 +01:00
Pawel "l0ner" Soltys
6b8b746a0f pull initial *BDS port from Justin Crawford (see github.com/Justasic/tmux-mem-cpu-load) 2015-01-10 17:58:34 +01:00
Pawel "l0ner" Soltys
ad096cbac6 Merge branch 'l0ner' of github.com:l0ner/tmux-mem-cpu-load into l0ner 2015-01-10 17:32:45 +01:00
Pawel "l0ner" Soltys
3e743ee1c2 Hide cpu usage graph if graph_lines == 0. 2015-01-10 17:32:08 +01:00
Pawel "l0ner" Soltys
220d260673 use sysinfo() to get load avg instead of parsing /proc/ file 2015-01-10 17:27:54 +01:00
Pawel "l0ner" Soltys
e7f2dd25e8 use sysinfo() to get ram stats instead of parsing meminfo file.
Idea pulled from seculabird gihub user.
see:
880f8b1967
2015-01-09 14:52:50 +01:00
Pawel "l0ner" Soltys
b02d0000e9 pulled Joe136 solution to MemAvailable being present in /proc/meminfo
on some systems
2015-01-09 14:10:26 +01:00
Pawel "l0ner" Soltys
5001bc4fe7 added custom interval test 2015-01-08 20:04:27 +01:00
Pawel "l0ner" Soltys
c6fc061f9d instead of using istringstream to convert form strin to int use stoi() function 2015-01-08 19:53:22 +01:00
Pawel "l0ner" Soltys
aadca0d325 cleanups, fix tests to follow new arguments 2015-01-08 19:52:46 +01:00
Pawel "l0ner" Soltys
d92113644c use version generated by cmake, some vim auto reindent 2015-01-08 19:31:25 +01:00
Pawel "l0ner" Soltys
28040b61da easier to read argv parse using command line argument parser by Michael Hanke 2015-01-07 20:57:25 +01:00
Pawel "l0ner" Soltys
e7ee4279f6 increase sleep time to full sec instead of 1-0.1s 2015-01-07 14:58:47 +01:00
Pawel "l0ner" Soltys
72f1b03078 shorter DEFINES for versioning 2015-01-07 14:31:49 +01:00
Pawel "l0ner" Soltys
42c93ac397 prune BOOST detection, minor tweaks
For not Boost is not needed, uncomment relative lines when it will be.
2015-01-07 14:15:28 +01:00
Pawel "l0ner" Soltys
8e9033ee1e restore headers 2015-01-07 14:15:08 +01:00
Matt McCormick
8aab7a817d Merge pull request #11 from PeterDaveHello/patch-1
Use svg instead of png to get better image quality
2015-01-05 17:00:26 -05:00
Peter Dave Hello
ad1637f05b Use svg instead of png to get better image quality 2015-01-05 20:03:07 +08:00
Pawel "l0ner" Soltys
7a9209e243 grime removal: useless includes and code 2015-01-04 18:51:43 +01:00
Pawel "l0ner" Soltys
26e89f95fa wrap lines that exceed 80 columns 2015-01-04 17:33:03 +01:00
Pawel "l0ner" Soltys
223868f554 reindent one line 2015-01-04 17:23:39 +01:00
Pawel "l0ner" Soltys
080e1be24d use static_cast<> instead of c-like cast 2015-01-04 17:23:05 +01:00
Pawel "l0ner" Soltys
47b9f62a10 include fixes to make it compile on osx, added *~ files to gitignore 2015-01-04 17:21:20 +01:00