-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1284b00
commit ecdf06f
Showing
2 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,59 @@ | ||
# psutil-golang-RawanMostafa | ||
# Psutils | ||
|
||
This repository implements a human-friendly lib for querying processes, memory info and cpu info | ||
|
||
## Table of Contents | ||
|
||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
|
||
|
||
## Installation | ||
|
||
Get the package | ||
|
||
```bash | ||
go get github.com/codescalersinternships/psutil-golang-RawanMostafa | ||
``` | ||
Import the package | ||
|
||
```go | ||
import github.com/codescalersinternships/psutil-golang-RawanMostafa/pkg | ||
``` | ||
|
||
## Usage | ||
|
||
The psutils package offers different APIs like: | ||
|
||
### 1. CPU related APIs | ||
|
||
```go | ||
cpuInfo, err := psutils.GetCpuInfo() | ||
if err != nil { | ||
//handle the error | ||
} | ||
``` | ||
|
||
### 2. Memory related APIs | ||
|
||
```go | ||
memInfo, err := psutils.GetMemInfo() | ||
if err != nil { | ||
//handle the error | ||
} | ||
``` | ||
### 3. Processes related APIs | ||
|
||
1. ```go | ||
procs, err := psutils.GetProcessList() | ||
if err != nil { | ||
//handle the error | ||
} | ||
``` | ||
|
||
2. ```go | ||
procDetails, err := psutils.GetProcessDetails(1) | ||
if err != nil { | ||
//handle the error | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters