Capture is a set of tools running on the server and providing information about underlying hardware to the Checkmate server.
Endpoint | Method | Description |
---|---|---|
/health |
GET | Returns 200 OK |
/metrics |
GET | Returns the all system metrics(cpu,memory,disk,host) |
/metrics/cpu |
GET | Returns the system cpu metrics |
/metrics/memory |
GET | Returns the system memory metrics |
/metrics/disk |
GET | Returns the system disk metrics |
/metrics/host |
GET | Returns the system host informations |
/ws/metrics |
GET | Returns the all system metrics(cpu,memory,disk,host) in every n seconds (n=2) |
{
"physical_core": integer, // Physical cores
"logical_core": integer, // Logical cores aka Threads
"frequency": integer, // Frequency in mHz
"current_frequency": integer, // Current Frequency in mHz
"temperature": float, // Temperature in Celsius
"free_percent": float, // Free percentage //* 1- Usage
"usage_percent": float // Usage percentage //* Total - Idle / Total
}
{
"total_bytes": integer, // Total space in bytes
"available_bytes": integer, // Available space in bytes
"used_bytes": integer, // Used space in bytes //* Total - Free - Buffers - Cached
"usage_percent": float // Usage Percent //* (Used / Total) * 100.0
}
[
{
"read_speed_bytes": integer, // WIP
"write_speed_bytes": integer, // WIP
"total_bytes": integer, // Total space of "/" in bytes
"free_bytes": integer, // Free space of "/" in bytes
"usage_percent": float // Usage Percent of "/"
}
]
{
"os": string, // linux, darwin, windows
"platform": string, // arch, debian, suse...
"kernel_version": string, // 6.10.10, 6.0.0, 6.10.0-zen...
}
CPU | GNU/Linux | Windows | MacOS |
---|---|---|---|
Physical Core Count | ✅ | - | - |
Logical Core Count | ✅ | - | - |
Frequency | ✅ | - | - |
Current Frequency | ✅ | - | - |
Temperature | ✅ | - | - |
Free Percent | ✅ | - | - |
Usage Percent | ✅ | - | - |
Memory | GNU/Linux | Windows | MacOS |
---|---|---|---|
Total Bytes | ✅ | - | - |
Available Bytes | ✅ | - | - |
Used Bytes | ✅ | - | - |
Usage Percent | ✅ | - | - |
Disk | GNU/Linux | Windows | MacOS |
---|---|---|---|
Read Speed Bytes | - | - | - |
Write Speed Byres | - | - | - |
Total Bytes | ✅ | - | - |
Free Bytes | ✅ | - | - |
Usage Percent | ✅ | - | - |
Host | GNU/Linux | Windows | MacOS |
---|---|---|---|
OS | ✅ | - | - |
Platform | ✅ | - | - |
Kernel Version | ✅ | - | - |
-
Git Clone
git clone REPO_LINK
-
Change your directory
cd capture
-
Install dependencies
go mod download
-
Build the project
just build
or
go build -o capture ./cmd/capture/
-
Run the project
./capture
or
go run ./cmd/capture/
-
Environment Variables
If you want to change the port or the API secret, you can use these environment variables:
PORT = your_port API_SECRET = your_secret GIN_MODE = release/debug
Usage:
# API_SECRET is required PORT=8080 API_SECRET=your_secret GIN_MODE=release ./capture # Minimal required configuration API_SECRET=your_secret ./capture