commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
101eac9f56dfdd949da8af18dc749310cc4db4ce | Guillaume Gomez | 2017-06-07T22:28:30 | Fix failure in case of read_to_string failure | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 5d0af44..5ef189e 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -239,7 +239,7 @@ pub fn get_all_data(file_path: &str) -> io::Result<String> {
let mut file = File::open(file_path)?;
let mut data = String::new();
- file.read_to_str... | 1 | 1 | 1 |
94897283a59bad10a1ae26348fdddd3a315b7d7e | Guillaume Gomez | 2017-05-17T19:22:23 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 6279d57..aed097c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.3.6"
+version = "0.3.7"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
4d46c98962879d4c22185e0dca6eb2d432d4d088 | Guillaume Gomez | 2017-05-17T18:01:16 | Fix overflow | diff --git a/src/linux/system.rs b/src/linux/system.rs
index b383ec8..5d0af44 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -36,7 +36,7 @@ impl System {
fn clear_procs(&mut self) {
if !self.processors.is_empty() {
let (new, old) = get_raw_times(&self.processors[0]);
- ... | 1 | 1 | 1 |
fdc4573904bdb4cdb6722b331b7af2d2eede4320 | Guillaume Gomez | 2017-05-10T17:53:36 | Fix linux build | diff --git a/Cargo.toml b/Cargo.toml
index bfc2043..6279d57 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.3.5"
+version = "0.3.6"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes"
diff --git a/src/linux/proces... | 2 | 3 | 3 |
70d81258eef991dd8f895c2396e91566f7a4b1be | Guillaume Gomez | 2017-05-10T17:38:05 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 6815719..bfc2043 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.3.4"
+version = "0.3.5"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
32fefc35a56d0ee783602a1bf29368a102864494 | Guillaume Gomez | 2017-05-10T17:37:35 | Fix runtime error | diff --git a/src/linux/processor.rs b/src/linux/processor.rs
index 5a60281..a5be9fa 100644
--- a/src/linux/processor.rs
+++ b/src/linux/processor.rs
@@ -128,15 +128,18 @@ impl Processor {
fn set(&mut self, user: u64, nice: u64, system: u64, idle: u64, iowait: u64,
irq: u64, softirq: u64, steal: u64, ... | 1 | 12 | 9 |
9197f343274bb25b788cf1f1491f7d94b3500123 | Guillaume Gomez | 2017-04-13T17:27:24 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 6a67c37..6815719 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.3.3"
+version = "0.3.4"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
7f89ae2da7a2e858661bf956479b2c59f4e6a84c | Guillaume Gomez | 2017-04-13T17:27:07 | Fix mac disks free space computation | diff --git a/src/mac/disk.rs b/src/mac/disk.rs
index 3690712..1d2f9f2 100644
--- a/src/mac/disk.rs
+++ b/src/mac/disk.rs
@@ -6,7 +6,7 @@
use ::DiskExt;
-use libc::{statfs, statvfs};
+use libc::statfs;
use std::{mem, str};
use std::fmt::{Debug, Error, Formatter};
@@ -41,7 +41,7 @@ pub fn new_disk(name: String, ... | 3 | 33 | 19 |
345a3fb15d070c583b20bba9b786930db886c918 | Guillaume Gomez | 2017-04-13T14:43:50 | Fix docs | diff --git a/src/traits.rs b/src/traits.rs
index 6d83c65..27353d5 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -87,7 +87,7 @@ pub trait SystemExt {
/// Returns a list of process starting with the given name.
fn get_process_by_name(&self, name: &str) -> Vec<&Process>;
- /// The first process in the a... | 1 | 1 | 1 |
5797731aac9332df35dcd633300b1cbce7f53ac2 | Onur Aslan | 2017-04-11T11:05:31 | Filter /proc/mounts lines starts with /dev/sd
Closes: #69 | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 6964d77..b383ec8 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -422,7 +422,7 @@ fn get_all_disks() -> Vec<Disk> {
let content = get_all_data("/proc/mounts").unwrap_or(String::new());
let disks: Vec<_> = content.lines()
... | 1 | 1 | 1 |
dee77f94ef7e47be815ae1428837a1ad7432547e | Onur Aslan | 2017-04-11T09:51:04 | Use RSS for Process::memory on Linux | diff --git a/src/linux/system.rs b/src/linux/system.rs
index a1f0f98..6964d77 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -267,10 +267,9 @@ fn update_time_and_memory(path: &Path, entry: &mut Process, parts: &[&str], page
parent_memory: u64, pid: pid_t) {
//entry.name = ... | 1 | 2 | 3 |
3d53287b7e9ccedc6dd2ac4a4fbb6e96f3f8b15e | Guillaume Gomez | 2017-04-08T15:01:23 | Add a bit of docs | diff --git a/src/linux/process.rs b/src/linux/process.rs
index b222833..3f1450f 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -127,7 +127,8 @@ pub struct Process {
pub uid: uid_t,
/// Group id of the process owner.
pub gid: gid_t,
- /// Status of process (idle, run, zombie, etc).
+ ... | 2 | 4 | 2 |
aac362ed0608a92827769f19a3f40f1536b3c222 | Guillaume Gomez | 2017-04-07T17:04:40 | Add a bit more comments | diff --git a/src/mac/system.rs b/src/mac/system.rs
index 1b972d7..3d31169 100644
--- a/src/mac/system.rs
+++ b/src/mac/system.rs
@@ -328,6 +328,7 @@ impl SystemExt for System {
None
};
// getting CPU temperature
+ // "TC0P"
... | 1 | 3 | 0 |
d5f2aeabbd1d812e67edbf78c464d5127ef50521 | Guillaume Gomez | 2017-04-07T16:45:45 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index e9374e7..6a67c37 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.3.2"
+version = "0.3.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
07fda583f0b4bc72845f29c17fe21685edfeb8d3 | Guillaume Gomez | 2017-04-07T16:45:27 | Add status when displaying all processes | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 3a33044..f83fb49 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -79,7 +79,7 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
"quit" | "exit" => return true,
"all" => {
for (pid, proc_) in... | 1 | 1 | 1 |
a90a7c365a6c5bec918c1af5906e7e0ba1072a4d | Guillaume Gomez | 2017-04-07T16:44:28 | Add thread status and put it as default status on mac | diff --git a/src/mac/process.rs b/src/mac/process.rs
index 18e1712..d437d0b 100644
--- a/src/mac/process.rs
+++ b/src/mac/process.rs
@@ -59,6 +59,56 @@ impl fmt::Display for ProcessStatus {
}
}
+/// Enum describing the different status of a thread.
+#[derive(Clone, Debug)]
+pub enum ThreadStatus {
+ /// Thre... | 2 | 64 | 6 |
32cf544d7440b533ee896e571bcc592c859f9404 | Guillaume Gomez | 2017-04-04T22:52:29 | Little code clean | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index a4f482b..3a33044 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -28,7 +28,7 @@ fn print_help() {
writeln!(&mut io::stdout(), "help : show this menu");
writeln!(&mut io::stdout(), "signals : show th... | 2 | 6 | 5 |
9cedb7bd8813e60ac411f51cbf070e07bcb53ddb | Guillaume Gomez | 2017-03-14T18:51:05 | Prevent process to be task of himself | diff --git a/Cargo.toml b/Cargo.toml
index ecd0e01..e9374e7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.3.1"
+version = "0.3.2"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes"
diff --git a/src/linux/system... | 2 | 14 | 10 |
9865b41b10fb74a46b250919c89f266bc0e77d79 | Guillaume Gomez | 2017-03-13T10:29:00 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index ecedc58..ecd0e01 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.3.0"
+version = "0.3.1"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
35d50232efe0fd3fc8e43d38808eab49316aed8f | Guillaume Gomez | 2017-03-13T10:24:17 | Remove 100% limit | diff --git a/src/mac/process.rs b/src/mac/process.rs
index a169881..18e1712 100644
--- a/src/mac/process.rs
+++ b/src/mac/process.rs
@@ -166,9 +166,6 @@ pub fn compute_cpu_usage(p: &mut Process, time: u64, task_time: u64) {
} else {
(system_time_delta as f64 * 100f64 / time_delta as f64) as f32
};
- ... | 1 | 0 | 3 |
1d2413cdde62df5f0295a4ef2d3e00f4b21948ae | Guillaume Gomez | 2017-03-09T15:38:41 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 615cf7c..ecedc58 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.2.10"
+version = "0.3.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
c99ecf836ba695b39cd72c4dabec588e2b04ef35 | Guillaume Gomez | 2017-03-09T11:08:03 | Little fix in task memory computing | diff --git a/Cargo.toml b/Cargo.toml
index c08a8b4..615cf7c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.2.9"
+version = "0.2.10"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes"
diff --git a/src/linux/syste... | 2 | 2 | 2 |
eb689428eb181ae93ea5c0a4163edaa6e411dac8 | Guillaume Gomez | 2017-03-08T11:45:56 | Fix invalid str to C conversion | diff --git a/src/utils.rs b/src/utils.rs
index aaabf25..a66b0a1 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -20,8 +20,10 @@ pub fn realpath(original: &Path) -> PathBuf {
return PathBuf::from(ori);
}
let result = PathBuf::from(original);
+ let mut result_s = result.to_str().unwrap().as_bytes().... | 1 | 3 | 1 |
af8ef72cb971574f0465d2b8c2d5914eae016bf6 | Guillaume Gomez | 2017-02-19T10:54:45 | ProcessStatus cleanup | diff --git a/src/linux/process.rs b/src/linux/process.rs
index f6ecd76..ed0545f 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -9,8 +9,8 @@ use libc::{c_int, gid_t, kill, pid_t, uid_t};
use ::ProcessExt;
-/// Struct containing a process' information.
-#[derive(Clone)]
+/// Enum describing the diff... | 5 | 69 | 64 |
85497e565d6c369915a7b9090a1e7d3efa968511 | Guillaume Gomez | 2017-02-17T22:05:30 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 1a8fc3b..ae2a771 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.2.7"
+version = "0.2.8"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
3e4b57636ecd6333ae56bfe2d6b67a0103642635 | Guillaume Gomez | 2017-02-13T18:59:56 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 40b25b6..1a8fc3b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.2.6"
+version = "0.2.7"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
3131dc431b79de479b1bc32df4dcb628f8e869b7 | Guillaume Gomez | 2017-02-13T18:51:08 | Unify functions and doc by using traits | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 0952ef4..dd300c4 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -6,7 +6,7 @@
extern crate sysinfo;
extern crate libc;
-use sysinfo::*;
+use sysinfo::{ProcessExt, ProcessorExt, Signal, System, SystemExt};
use sysinfo::Signal::*;... | 12 | 241 | 180 |
c007a1ea1b0be7e918ef1f5b537492c713652a1e | Guillaume Gomez | 2017-02-13T18:15:09 | Add refresh_disk_list method | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 520a8ad..0952ef4 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -23,6 +23,7 @@ fn print_help() {
writeln!(&mut io::stdout(), "help : show this menu");
writeln!(&mut io::stdout(), "signals : show th... | 3 | 16 | 0 |
14b79ed64bcf8293326cfb2566f2a94bc9437de7 | Guillaume Gomez | 2017-02-13T17:15:33 | Update version number | diff --git a/Cargo.toml b/Cargo.toml
index c7d239b..40b25b6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "sysinfo"
-version = "0.2.5"
-authors = ["guillaume1.gomez@gmail.com"]
+version = "0.2.6"
+authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handl... | 1 | 2 | 2 |
4abe85d6281c39dacb7b9f04b40d00190dfd8200 | Guillaume Gomez | 2017-02-10T17:27:34 | Add more information for crates.io | diff --git a/Cargo.toml b/Cargo.toml
index 91c0512..c7d239b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,6 +7,8 @@ description = "Library to handle processes"
repository = "https://github.com/GuillaumeGomez/sysinfo"
license = "LGPL-3.0+"
+categories = ["filesystem", "os", "os::macos-apis", "os::unix-apis"]
+
bui... | 1 | 6 | 0 |
0cf0dd089ce1674b0c1bd36d6340687d43e892a6 | Guillaume Gomez | 2017-02-10T17:21:08 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 9a3c5ff..91c0512 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.2.4"
+version = "0.2.5"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processes" | 1 | 1 | 1 |
7b093f631784433a7f31eee41a37fb2e430a1dd9 | Guillaume Gomez | 2017-02-03T12:41:05 | Add memory cleanup | diff --git a/src/mac/system.rs b/src/mac/system.rs
index bd9c0c0..d950a85 100644
--- a/src/mac/system.rs
+++ b/src/mac/system.rs
@@ -160,14 +160,15 @@ macro_rules! unwrapper {
}
unsafe fn check_value(dict: ffi::CFMutableDictionaryRef, key: &[u8]) -> bool {
- // If I try to free key, the program crashes so let's ... | 1 | 5 | 4 |
f60b77d631de911dd32ca94c7acaaf443c7f3f39 | Guillaume Gomez | 2017-02-02T22:59:29 | Remove processes that aren't here anymore | diff --git a/Cargo.toml b/Cargo.toml
index a6d6d5d..9a3c5ff 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.2.3"
+version = "0.2.4"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processes"
diff --git a/src/mac/process.rs b/src/mac/proce... | 3 | 22 | 5 |
375e076e6a5492f805c99496d3fa99a00569ca46 | Guillaume Gomez | 2017-02-02T22:23:20 | Fix invalid deallocation on mac | diff --git a/Cargo.toml b/Cargo.toml
index d9dc621..a6d6d5d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.2.2"
+version = "0.2.3"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processes"
diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
in... | 3 | 5 | 2 |
da8e34e50727d1b837d4970b0de1d2029ebcc492 | Guillaume Gomez | 2017-02-02T17:49:32 | Add disks information for mac as well | diff --git a/Cargo.toml b/Cargo.toml
index a4eb9fe..d9dc621 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.2.1"
+version = "0.2.2"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processes"
diff --git a/build.rs b/build.rs
index 40971f9.... | 12 | 331 | 52 |
2564da2b4f1da3105f0d27b622cd5d9580cb6891 | Guillaume Gomez | 2017-02-01T18:44:46 | Add disk information | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index aaaca4a..cd74a50 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -13,23 +13,29 @@ use std::str::FromStr;
use std::io::Write;
use libc::pid_t;
-const signals : [Signal; 31] = [Hangup, Interrupt, Quit, Illegal, Trap, Abort, Bus, Fl... | 5 | 197 | 27 |
2d759b90dbea613071363c3316ecf6427f8ce104 | Sebastian Hahn | 2016-12-13T09:10:20 | Update examples create to work with libc types | diff --git a/examples/Cargo.toml b/examples/Cargo.toml
index 7689d5f..dccbba7 100644
--- a/examples/Cargo.toml
+++ b/examples/Cargo.toml
@@ -6,5 +6,8 @@ authors = ["guillaume1.gomez@gmail.com"]
[dependencies.sysinfo]
path = ".."
+[dependencies]
+libc = "^0.2"
+
[[bin]]
-name = "simple"
\ No newline at end of file
... | 2 | 8 | 3 |
debce09627b13d9f78339a2849e870186f81f803 | Sebastian Hahn | 2016-12-13T07:53:05 | Use libc types instead of creating our own artificially | diff --git a/src/linux/ffi.rs b/src/linux/ffi.rs
deleted file mode 100644
index a3fa11f..0000000
--- a/src/linux/ffi.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// Sysinfo
-//
-// Copyright (c) 2015 Guillaume Gomez
-//
-
-use libc::c_int;
-
-extern "C" {
- pub fn kill(pid: c_int, signal: c_int) -> c_int;
-}
diff --git ... | 7 | 36 | 52 |
13fa05d049bf17f6d63ba679980c0c363b4a8679 | Sebastian Hahn | 2016-12-13T07:31:53 | Report the effective uid field, not saved
This is an off-by-one bug in the field parsing :( | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 0d48308..e5a86ba 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -291,7 +291,7 @@ fn _get_process_data(path: &Path, proc_list: &mut HashMap<usize, Process>, page_
let f = |h: &str, n: &str| -> Option<i64> {
if h.s... | 1 | 1 | 1 |
3ea092944c561fcccf66d7cab2efe8da8f01f972 | Sebastian Hahn | 2016-12-10T06:50:44 | Expose uid and gid information about processes
Implements #27 | diff --git a/src/linux/process.rs b/src/linux/process.rs
index eb984c7..4283430 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -37,6 +37,11 @@ pub struct Process {
updated: bool,
/// total cpu usage
pub cpu_usage: f32,
+ /// user id of the process owner
+ pub uid: i64,
+ /// gro... | 4 | 49 | 0 |
1cfa5a7faa494721f748c9a14343e68b524b9bda | Sebastian Hahn | 2016-12-09T17:53:41 | Use writeln instead of write + \n | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index def2912..ead8986 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -16,17 +16,17 @@ const signals : [Signal; 31] = [Hangup, Interrupt, Quit, Illegal, Trap, Abort, B
Profiling, Winch, IO, Power, Sys];
fn print_help() -> bool {
-... | 3 | 57 | 57 |
f2d92e6b5414dab887bf3c1d3a2b679f9d75a8d4 | Sebastian Hahn | 2016-12-09T13:07:23 | Provide cmdline as vector
This gets rid of ambiguities related to beginning/end of executable
name/cmdline arguments. | diff --git a/src/linux/process.rs b/src/linux/process.rs
index 5b92372..b4680b4 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -12,8 +12,8 @@ use libc::{c_int};
pub struct Process {
/// name of the program
pub name: String,
- /// command line
- pub cmd: String,
+ /// command line, s... | 4 | 21 | 32 |
0d93966101e3051d7786efa3a421fe2447595852 | Sebastian Hahn | 2016-12-09T12:31:08 | Handle processes with spaces in their name | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 68e8ef7..fde8946 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -247,7 +247,25 @@ fn _get_process_data(path: &Path, proc_list: &mut HashMap<usize, Process>, page_
tmp.push("stat");
let data = get_all_data(tmp.to_str(... | 1 | 22 | 5 |
030882701966f7281e17361eae33f9e256290aea | Guillaume Gomez | 2016-12-07T17:51:00 | Remove ":" command splitting in linux | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 04bb6e8..68e8ef7 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -270,8 +270,7 @@ fn _get_process_data(path: &Path, proc_list: &mut HashMap<usize, Process>, page_
} else {
String::new()
};
- ... | 1 | 1 | 2 |
cd62c8aa86cad379b232fc830c445305249ec6c3 | Sebastian Hahn | 2016-12-03T06:18:26 | Use None for parent to indicate root process | diff --git a/src/linux/process.rs b/src/linux/process.rs
index 68bd1f2..5b92372 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -19,7 +19,7 @@ pub struct Process {
/// pid of the process
pub pid: i64,
/// pid of the parent process
- pub parent: i64,
+ pub parent: Option<i64>,
/... | 4 | 19 | 8 |
7dc26f538a5c764a12b94aa1e90bd7be1bf521a7 | Sebastian Hahn | 2016-12-02T05:08:21 | Handle parent PID for process | diff --git a/src/linux/process.rs b/src/linux/process.rs
index 3b75212..68bd1f2 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -18,6 +18,8 @@ pub struct Process {
pub exe: String,
/// pid of the process
pub pid: i64,
+ /// pid of the parent process
+ pub parent: i64,
/// envir... | 4 | 14 | 3 |
4906d31af56a6b9549eec0c3c6008b01b6e60fc0 | Sebastian Hahn | 2016-12-02T05:07:32 | Remove unused import | diff --git a/src/mac/system.rs b/src/mac/system.rs
index 6c788dd..4ce3420 100644
--- a/src/mac/system.rs
+++ b/src/mac/system.rs
@@ -9,7 +9,7 @@ use sys::component::Component;
use sys::processor::*;
use sys::process::*;
use std::collections::HashMap;
-use libc::{self, c_void, c_int, size_t, stat, c_char, sysconf, _S... | 1 | 1 | 1 |
b875713f718b68a2635bfd6df0d72cd7e5f71fdd | Sebastian Hahn | 2016-12-02T05:06:35 | Fix typo for proc_bsdinfo member
See documentation at
https://opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/sys/proc_info.h | diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
index fa3d3b9..7432587 100644
--- a/src/mac/ffi.rs
+++ b/src/mac/ffi.rs
@@ -93,7 +93,7 @@ pub struct proc_bsdinfo {
pub pbi_status: u32,
pub pbi_xstatus: u32,
pub pbi_pid: u32,
- pub ppbi_pid: u32,
+ pub pbi_ppid: u32,
pub pbi_uid: uid_t,
pub p... | 1 | 1 | 1 |
2c900e939e32b7b39555e0478fbe186db1885a24 | Sebastian Hahn | 2016-12-02T04:49:24 | Fix spelling for process
processus is French, not English. | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 3d54132..def2912 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -21,7 +21,7 @@ fn print_help() -> bool {
write!(&mut io::stdout(), "signals : show the available signals\n");
write!(&mut io::stdout(), "refresh ... | 4 | 7 | 7 |
7b757c08a6cc4a7d27b85cd1aff6cf15356bc75c | Guillaume Gomez | 2016-10-20T22:17:01 | remove useless linkage from cargo file | diff --git a/Cargo.toml b/Cargo.toml
index f8cf51b..77e487f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,6 +16,3 @@ libc = "^0.2"
name = "sysinfo"
crate_type = ["rlib"]
path = "src/sysinfo.rs"
-
-[target.'cfg(target_os = "macos")'.sysinfo]
-links = "IOKit.framework" | 1 | 0 | 3 |
35dd7305632b85e14c750af2abba291ce42fdb60 | Guillaume Gomez | 2016-10-20T13:07:35 | Add swap usage for mac | diff --git a/Cargo.toml b/Cargo.toml
index a862ed6..f8cf51b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.2.0"
+version = "0.2.1"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
in... | 3 | 23 | 1 |
e3bd0264cc5e1052e6540e86a11e41f112bb6071 | Guillaume Gomez | 2016-10-16T22:41:12 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 834de58..a862ed6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.15"
+version = "0.2.0"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus" | 1 | 1 | 1 |
7cc77904bda423f99716784236bc708d54a8d145 | Guillaume Gomez | 2016-10-16T22:38:33 | Cleanup on linux side | diff --git a/src/linux/component.rs b/src/linux/component.rs
index 890fe24..b4f9f76 100644
--- a/src/linux/component.rs
+++ b/src/linux/component.rs
@@ -6,11 +6,11 @@
use std::collections::HashMap;
use std::fs::{File, read_dir};
-use std::fmt::{Debug, Error, Formatter};
use std::io::Read;
use std::path::{Path, Pa... | 4 | 9 | 11 |
7237a656f4739690a14f7de1c9da5acbad4d51a7 | Guillaume Gomez | 2016-10-16T17:55:26 | Add temperature handling | diff --git a/Cargo.toml b/Cargo.toml
index fa92785..834de58 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,6 +7,8 @@ description = "Library to handle processus"
repository = "https://github.com/GuillaumeGomez/sysinfo"
license = "LGPL-3.0+"
+build = "build.rs"
+
[dependencies]
libc = "^0.2"
@@ -14,3 +16,6 @@ lib... | 5 | 345 | 1 |
4da3e79300af31d5264e4084254bb1273ba5f54e | Guillaume Gomez | 2016-10-15T23:45:39 | Add correct free memory | diff --git a/src/ffi.rs b/src/ffi.rs
index 98d7e3e..5c5c8ff 100644
--- a/src/ffi.rs
+++ b/src/ffi.rs
@@ -37,6 +37,7 @@ extern "C" {
pub fn mach_task_self() -> u32;
pub fn mach_host_self() -> u32;
pub fn task_info(host_info: u32, t: u32, c: *mut c_void, x: *mut u32) -> u32;
+ pub fn host_statistics64(h... | 4 | 92 | 15 |
4324b5193480f8883803e705fe458d72f6156bef | Guillaume Gomez | 2016-10-15T17:22:31 | fix invalid cpu computation | diff --git a/src/ffi.rs b/src/ffi.rs
index b752ad7..98d7e3e 100644
--- a/src/ffi.rs
+++ b/src/ffi.rs
@@ -30,9 +30,13 @@ extern "C" {
pub fn memcpy(dst: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn perror(c: *const c_char);
+ pub fn getpid() -> i32;
+ pub fn mach_absolute_time()... | 3 | 114 | 2 |
838d388bca5ac6435c614107c6d8b5330f1e0427 | Guillaume Gomez | 2016-10-15T13:34:38 | Processes and Processors info are working | diff --git a/src/ffi.rs b/src/ffi.rs
index 09e186f..b752ad7 100644
--- a/src/ffi.rs
+++ b/src/ffi.rs
@@ -28,6 +28,16 @@ extern "C" {
pub fn sysctl(name: *mut c_int, namelen: c_uint, oldp: *mut c_void, oldlenp: *mut size_t,
newp: *mut c_void, newlen: size_t) -> c_int;
pub fn memcpy(dst: *mut... | 3 | 340 | 94 |
1b526216b7bf491b9ac95b051c9922d201c64697 | Guillaume Gomez | 2016-09-17T13:37:25 | Great improvement to get all processes' info | diff --git a/src/ffi.rs b/src/ffi.rs
index 28497f8..09e186f 100644
--- a/src/ffi.rs
+++ b/src/ffi.rs
@@ -6,25 +6,46 @@
use libc::c_int;
#[cfg(target_os = "macos")]
-use libc::{c_char, c_void, gid_t, uid_t};
+use libc::{c_char, c_void, gid_t, uid_t, c_uint, size_t};
extern "C" {
pub fn kill(pid: c_int, signa... | 2 | 151 | 80 |
88449878b4fdeb8707e2201c2a4c44b572b66b28 | Guillaume Gomez | 2016-09-16T23:25:34 | Beginning of macos support | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 54ba090..3d54132 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -25,6 +25,7 @@ fn print_help() -> bool {
write!(&mut io::stdout(), "proc : Displays proc state\n");
write!(&mut io::stdout(), "memory ... | 5 | 219 | 40 |
46622ce0fe520d625615a5c738615445ef46b0d0 | Guillaume Gomez | 2016-06-07T22:14:43 | Fix invalid free RAM value | diff --git a/Cargo.toml b/Cargo.toml
index 7927e13..fa92785 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.14"
+version = "0.1.15"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/src/system.rs b/src/system.rs
in... | 2 | 2 | 2 |
2271f7d60ac59795591f05b2a7681a669b8789ea | Guillaume Gomez | 2016-06-07T20:30:19 | Fix invalid memory usage values | diff --git a/Cargo.toml b/Cargo.toml
index 8e37e68..7927e13 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.13"
+version = "0.1.14"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/src/system.rs b/src/system.rs
in... | 2 | 18 | 10 |
90403f603ebbd445321d7db0dec48b2e0b2d0252 | Guillaume Gomez | 2016-04-02T23:48:10 | Convert start time to seconds | diff --git a/Cargo.toml b/Cargo.toml
index 7ecb099..8e37e68 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.12"
+version = "0.1.13"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/src/process.rs b/src/process.rs
... | 3 | 8 | 5 |
c4a9f452e547d609f0e104a1d4fed495e373a49b | Guillaume Gomez | 2016-03-31T15:11:57 | Set start_time field public ad add doc comment instead of comment | diff --git a/Cargo.toml b/Cargo.toml
index ee4aa3c..7ecb099 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.11"
+version = "0.1.12"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/src/process.rs b/src/process.rs
... | 2 | 21 | 11 |
33d40a886499cd213e02d639f7767b40a7134793 | Guillaume Gomez | 2016-03-31T14:41:54 | Fix indentation | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 3be5eab..54ba090 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -78,7 +78,7 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
};
} else {
let proc_name = tmp.ge... | 2 | 3 | 3 |
d1d2edaacf12e8aac9af6561bed473d3bd41bdd3 | ggomez | 2016-04-01T14:44:55 | * Fix invalid folder links
* Fix debug
* Change crate version | diff --git a/Cargo.toml b/Cargo.toml
index 62c7817..ee4aa3c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.10"
+version = "0.1.11"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/examples/src/simple.rs b/example... | 4 | 55 | 43 |
8a380665056f5c827095420ee5b0c3090797c32f | Guillaume Gomez | 2016-03-27T22:42:24 | Set back Component's fields public and add doc comment | diff --git a/Cargo.toml b/Cargo.toml
index 94fe657..62c7817 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.9"
+version = "0.1.10"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/src/component.rs b/src/component.... | 2 | 10 | 21 |
c69a6d51e19f4c793728f2495ec0af6085c99a73 | ggomez | 2016-03-21T10:46:12 | Add max and critical temperatures | diff --git a/Cargo.toml b/Cargo.toml
index c0202b2..94fe657 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.8"
+version = "0.1.9"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/examples/src/simple.rs b/examples/... | 3 | 76 | 19 |
e5936dd5180cdcc4b6c6a0b0b10872b8013bf5af | ggomez | 2016-03-14T16:36:45 | Fix invalid process command name | diff --git a/Cargo.toml b/Cargo.toml
index cd411ce..c0202b2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.7"
+version = "0.1.8"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/src/system.rs b/src/system.rs
inde... | 2 | 8 | 2 |
0c4ff4516a9a4611943ca2b2b69621a4e75d16de | ggomez | 2016-03-14T11:16:45 | Sort components | diff --git a/Cargo.toml b/Cargo.toml
index 16678d2..cd411ce 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.6"
+version = "0.1.7"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/src/component.rs b/src/component.r... | 2 | 2 | 1 |
8d050a8caa0602318d54c5b724cce1286610409f | Guillaume Gomez | 2016-03-10T14:37:26 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index e61f634..16678d2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.5"
+version = "0.1.6"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
@@ -13,4 +13,4 @@ libc = "^0.2"
[lib]
name = ... | 1 | 2 | 2 |
13805d97b14f541588848247537ba110aeeb3dbc | Guillaume Gomez | 2016-03-10T14:05:17 | Reset reader when needed | diff --git a/src/component.rs b/src/component.rs
index daf5afa..3cc2543 100644
--- a/src/component.rs
+++ b/src/component.rs
@@ -93,7 +93,8 @@ impl Component {
f.read_to_string(&mut reader).unwrap();
self.label = reader.replace("\n", "");
let mut f = File::open(self.input_file.as_path()).unwr... | 1 | 2 | 1 |
fe2e79c07bb5f5adbf1fc556a699a2c3dc549c49 | Guillaume Gomez | 2016-03-10T14:03:43 | Get components info | diff --git a/src/system.rs b/src/system.rs
index a75800c..d259227 100644
--- a/src/system.rs
+++ b/src/system.rs
@@ -37,7 +37,7 @@ impl System {
swap_free: 0,
processors: Vec::new(),
page_size_kb: unsafe { sysconf(_SC_PAGESIZE) as u64 / 1024 },
- temperatures: Vec::new(... | 1 | 1 | 1 |
4076d9aba94ae7fb1397e9eb35c5a68b9a41fa4c | Guillaume Gomez | 2016-03-10T00:25:27 | Add components temperature | diff --git a/Cargo.toml b/Cargo.toml
index 19e544f..e61f634 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.4"
+version = "0.1.5"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/examples/src/simple.rs b/examples/... | 6 | 129 | 12 |
834308fe4d1b6e2d05b8923d93ee988c85b8ee21 | Guillaume Gomez | 2016-03-04T10:43:24 | Improve recovery of process' name | diff --git a/Cargo.toml b/Cargo.toml
index 72c02b7..19e544f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.3"
+version = "0.1.4"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/src/sysinfo.rs b/src/sysinfo.rs
in... | 3 | 71 | 70 |
aeabe6605083bf116ea81fb001589cec4d9fdf53 | Guillaume Gomez | 2016-01-02T23:51:05 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 7ffe7ac..72c02b7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.2"
+version = "0.1.3"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus" | 1 | 1 | 1 |
48dce2bff3b35d02b19d1cd0f0eec66d94e824fc | Guillaume Gomez | 2015-11-05T22:43:43 | Update to last rustc version | diff --git a/Cargo.toml b/Cargo.toml
index 86a62eb..7ffe7ac 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.1.0"
+version = "0.1.2"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
@@ -8,7 +8,7 @@ repository = "https://github.co... | 3 | 5 | 8 |
dee695fec51ac278224282584cbefc1faaf4e584 | Guillaume Gomez | 2015-09-07T12:22:33 | Improve performance | diff --git a/Cargo.toml b/Cargo.toml
index 6189fef..86a62eb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.0.3"
+version = "0.1.0"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
@@ -8,7 +8,7 @@ repository = "https://github.co... | 2 | 9 | 21 |
c43a6047bcf55077235983e68c6bde568a6d4e69 | Guillaume Gomez | 2015-08-21T22:15:09 | Fix cpu % miscalculation | diff --git a/Cargo.toml b/Cargo.toml
index fc6b851..6189fef 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.0.2"
+version = "0.0.3"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
diff --git a/src/process.rs b/src/process.rs
in... | 4 | 24 | 84 |
6cfeffbd93ffc0407686e3c57a1f901b4764caeb | Guillaume Gomez | 2015-08-20T22:52:34 | Few improvements (still not good values but a lot more fast !) | diff --git a/src/process.rs b/src/process.rs
index b2596ee..8fb46d4 100644
--- a/src/process.rs
+++ b/src/process.rs
@@ -18,10 +18,17 @@ pub struct Process {
pub root: String, // path of the root directory
pub memory: u64, // memory usage
utime: u64,
+ cutime: u64,
stime: u64,
+ cstime: u64,
+... | 3 | 198 | 84 |
8ef94cb3d5e7e4d0cdd6c466a2120d7323dd1b3c | Guillaume Gomez | 2015-07-23T22:03:17 | Update version | diff --git a/Cargo.toml b/Cargo.toml
index 1c8beea..fc6b851 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.0.1"
+version = "0.0.2"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus" | 1 | 1 | 1 |
4e7dda144fa743af10c3f8dfedd1c9c6b80bac8e | Guillaume Gomez | 2015-07-23T22:03:02 | Update to last rustc version | diff --git a/src/processor.rs b/src/processor.rs
index 7586f66..7de9c57 100644
--- a/src/processor.rs
+++ b/src/processor.rs
@@ -68,7 +68,7 @@ impl Processor {
fn new_with_values(name: &str, user: u64, nice: u64, system: u64, idle: u64, total_time: u64) -> Processor {
Processor {
- name: Stri... | 3 | 14 | 14 |
374f331931a55ac3818274059fb9b765f57ccbe3 | Guillaume Gomez | 2015-06-05T20:22:52 | Fix example | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 1fffa92..1555bed 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -71,7 +71,7 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
} else {
let pid = i64::from_str(tmp.get(1).unwrap()).unwrap();... | 1 | 2 | 2 |
01c93c51cfbe75d02e74189446f41df0f101df83 | Guillaume Gomez | 2015-06-05T20:12:59 | End of renaming process | diff --git a/src/process.rs b/src/process.rs
index e1c6570..b2596ee 100644
--- a/src/process.rs
+++ b/src/process.rs
@@ -78,6 +78,6 @@ pub fn compute_cpu_usage(p: &mut Process, old_utime: u64, old_stime: u64, total_
+ (p.stime - old_stime) as f32 / (total_time - old_total_time) as f32) * 25f32;
}
-pub fn ge... | 2 | 5 | 5 |
432f9e2b1904d66a2e9ef945c122b31bcc5920c7 | Guillaume Gomez | 2015-06-05T20:06:35 | Change names | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index a30f6cb..1fffa92 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -32,7 +32,7 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
"help" => print_help(),
"refresh" => {
write!(&mut io::stdout(... | 6 | 262 | 258 |
4d0680724de4d43663b379d596c9332121df6ad4 | Guillaume Gomez | 2015-05-30T22:17:04 | fix examples | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 8b66092..a30f6cb 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -56,9 +56,9 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
},
"memory" => {
write!(&mut io::stdout(), "total memory: {} k... | 4 | 11 | 14 |
449a12c4fbbffbe1253cc3a273021787b0cf7517 | Guillaume Gomez | 2015-05-30T21:49:11 | Good computation of cpu usage for every process | diff --git a/src/processus.rs b/src/processus.rs
index 9f564fc..b786205 100644
--- a/src/processus.rs
+++ b/src/processus.rs
@@ -19,6 +19,8 @@ pub struct Processus {
pub memory: u64, // memory usage
utime: u64,
stime: u64,
+ old_utime: u64,
+ old_stime: u64,
pub cpu_usage: f32 // total cpu usa... | 2 | 10 | 2 |
c462a768675994c0d3ff26d50883490ae0cd4fc3 | Guillaume Gomez | 2015-05-29T00:07:12 | Needed updates | diff --git a/src/system.rs b/src/system.rs
index f452592..fe825a8 100644
--- a/src/system.rs
+++ b/src/system.rs
@@ -21,7 +21,7 @@ use std::path::Component::Normal;
pub struct System {
processus_list: VecMap<Processus>,
mem_total: u64,
- mem_free: u64,
+ mem_used: u64,
swap_total: u64,
swap_f... | 1 | 8 | 7 |
2336f2e28ea47684f6d057b44ca652ac89f3b23a | Guillaume Gomez | 2015-05-25T09:09:24 | Fix typo | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index cce7b1e..8b66092 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -58,7 +58,7 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
write!(&mut io::stdout(), "total memory: {} kB\n", sys.get_total_memory());
... | 2 | 2 | 2 |
9c6289837b3e9777f190dddc77af12ce7e2510e2 | Guillaume Gomez | 2015-04-29T21:28:58 | Add clone trait to Processus struct | diff --git a/src/processus.rs b/src/processus.rs
index 690facc..9f564fc 100644
--- a/src/processus.rs
+++ b/src/processus.rs
@@ -7,6 +7,7 @@
use std::fmt::{self, Formatter, Debug};
use libc::{c_int};
+#[derive(Clone)]
pub struct Processus {
pub name: String, // name of the program
pub cmd: String, // com... | 1 | 1 | 0 |
989141ee210ed42f5cb7ce6eb0633a7e865e832c | Guillaume Gomez | 2015-04-29T18:25:37 | Update to last rustc version | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 305e0bd..cce7b1e 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -1,7 +1,5 @@
#![crate_type = "bin"]
-#![feature(core)]
-
#![allow(unused_must_use, non_upper_case_globals)]
extern crate sysinfo;
@@ -127,9 +125,9 @@ fn main() ... | 4 | 77 | 84 |
9cad2e5763d8788de7222a01761cb1f1a16a7aa5 | Guillaume Gomez | 2015-04-10T23:42:32 | Get executable name from another place | diff --git a/src/system.rs b/src/system.rs
index 8e75f63..1488cf6 100644
--- a/src/system.rs
+++ b/src/system.rs
@@ -188,6 +188,12 @@ fn _get_processus_data(path: &PosixPath, proc_list: &VecMap<Processus>) -> Optio
tmp.push("cmdline");
p.cmd = String::from_str(copy_from_file(&tmp)[0].as_slic... | 1 | 6 | 6 |
ecf5c8a8ea4b1d02981dd0b7d55af4b74db1231b | Guillaume Gomez | 2015-04-10T23:21:57 | Update to last rustc version | diff --git a/src/process.rs b/src/process.rs
index ca43e43..3060781 100644
--- a/src/process.rs
+++ b/src/process.rs
@@ -6,7 +6,7 @@
use std::fmt::{self, Formatter, Debug};
-#[derive(Copy)]
+#[derive(Clone, Copy)]
pub struct CpuValues {
user: u64,
nice: u64,
diff --git a/src/system.rs b/src/system.rs
in... | 2 | 3 | 3 |
6b502f67bf495c9b3137af48c359fbb6dd60e220 | Guillaume Gomez | 2015-03-31T22:31:46 | Add executable name | diff --git a/src/processus.rs b/src/processus.rs
index e22c6a3..690facc 100644
--- a/src/processus.rs
+++ b/src/processus.rs
@@ -8,6 +8,7 @@ use std::fmt::{self, Formatter, Debug};
use libc::{c_int};
pub struct Processus {
+ pub name: String, // name of the program
pub cmd: String, // command line
pub ... | 2 | 10 | 0 |
52a2a8b9ad32e5ae0c7d9d2564224b9d070b97f0 | Guillaume Gomez | 2015-03-31T22:06:06 | Update to last rustc version | diff --git a/src/ffi.rs b/src/ffi.rs
index 999fe91..7dee510 100644
--- a/src/ffi.rs
+++ b/src/ffi.rs
@@ -1,3 +1,9 @@
+//
+// Sysinfo
+//
+// Copyright (c) 2015 Guillaume Gomez
+//
+
use libc::{c_int};
extern "C" {
diff --git a/src/process.rs b/src/process.rs
index 942389e..ca43e43 100644
--- a/src/process.rs
+++ ... | 5 | 33 | 16 |
5591a0f688e3ff8de4b9fcea0792ed9b8c998e28 | Guillaume Gomez | 2015-03-21T18:14:56 | Add beginning of cpu usage | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index a9dd965..305e0bd 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -71,7 +71,7 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
write!(&mut io::stdout(), "show command takes the pid in parameter !\n");
... | 4 | 141 | 97 |
de7909c96f399f69c84d04795ea3d641474727e5 | Guillaume Gomez | 2015-03-20T22:10:31 | Add memory and cpu usage | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 45cd056..a9dd965 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -1,6 +1,6 @@
#![crate_type = "bin"]
-#![feature(io, core)]
+#![feature(core)]
#![allow(unused_must_use, non_upper_case_globals)]
@@ -18,12 +18,14 @@ const sign... | 4 | 234 | 11 |
9321ca0cc6a85dafefaf973679dd8508e100f25f | Guillaume Gomez | 2015-03-20T08:48:42 | Update system.rs | diff --git a/src/system.rs b/src/system.rs
index 785c60a..98dd1a3 100644
--- a/src/system.rs
+++ b/src/system.rs
@@ -116,12 +116,13 @@ fn _get_processus_data(path: &PosixPath) -> Option<Processus> {
let lines : Vec<&str> = data.split('\n').collect();
for... | 1 | 3 | 2 |
13f8d54b4d1cacf14c3a694bfbc32bde4e482b24 | Guillaume Gomez | 2015-03-18T01:30:57 | Add memory usage | diff --git a/src/processus.rs b/src/processus.rs
index 079e483..b244781 100644
--- a/src/processus.rs
+++ b/src/processus.rs
@@ -7,7 +7,8 @@ pub struct Processus {
pub pid: i32, // pid of the processus
pub environ: Vec<String>, // environment of the processus
pub cwd: String, // current working directory... | 2 | 22 | 2 |
16b61661ed6fe1cce08989da5dbb47477935aed7 | Guillaume Gomez | 2015-03-12T02:34:58 | Add kill functions and Signal enum | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 23400d2..45cd056 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -1,20 +1,29 @@
#![crate_type = "bin"]
-#![feature(path)]
+#![feature(io, core)]
+
+ #![allow(unused_must_use, non_upper_case_globals)]
extern crate sysinfo;
us... | 5 | 147 | 36 |
447c9a36214955b345ee646547e0ffe5af092899 | Guillaume Gomez | 2015-03-11T22:32:19 | Rename files | diff --git a/Cargo.toml b/Cargo.toml
index e2ceeac..1c8beea 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,16 +1,16 @@
[package]
-name = "system"
+name = "sysinfo"
version = "0.0.1"
authors = ["guillaume1.gomez@gmail.com"]
description = "Library to handle processus"
-repository = "https://github.com/GuillaumeGome... | 5 | 26 | 17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.