added readme
This commit is contained in:
parent
1f477106f3
commit
019508be2d
2 changed files with 27 additions and 4 deletions
26
README.md
26
README.md
|
@ -19,3 +19,29 @@
|
|||
```bash
|
||||
npm install promstats
|
||||
```
|
||||
|
||||
## 🔧 Configuration
|
||||
Before using any functions, you must configure the Prometheus endpoint:
|
||||
```js
|
||||
import { setUrlEndpoint } from 'promstats';
|
||||
setUrlEndpoint('http://localhost:9090');
|
||||
```
|
||||
|
||||
## Usage:
|
||||
```js
|
||||
import { setUrlEndpoint, CPU, RAM, System } from 'promstats';
|
||||
|
||||
setUrlEndpoint('http://localhost:9090');
|
||||
|
||||
CPU.getCpuLoad().then(load => {
|
||||
console.log('CPU Load:', load);
|
||||
});
|
||||
|
||||
RAM.getUsedMemory().then(used => {
|
||||
console.log('Used Memory:', used);
|
||||
});
|
||||
|
||||
System.getOsName().then(os => {
|
||||
console.log('OS Name:', os);
|
||||
});
|
||||
```
|
||||
|
|
|
@ -172,7 +172,4 @@ export class CPU {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue