You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mactop-scraper is a lightweight client tool designed to collect, store, and analyze system metrics from mactop running in server mode on Apple Silicon Macs. It periodically fetches real-time performance data via the Prometheus-compatible HTTP endpoint exposed by mactop, enabling you to build custom datasets for monitoring, analysis, or visualization.
2
3
3
4
Typical use cases include:
@@ -6,4 +7,73 @@ Typical use cases include:
6
7
- Local or remote metric storage for later analysis
7
8
- Integrating MacBook hardware telemetry into your own workflows
8
9
9
-
> Note: This project assumes you have `mactop` installed and running with its server functionality enabled.
10
+
> Note: This project assumes you have `mactop` installed and running with its server functionality enabled.
11
+
12
+
13
+
# Features
14
+
15
+
- Real-time Metric Collection: Periodically fetches performance data from mactop.
16
+
17
+
- Prometheus-compatible Endpoint: Integrates seamlessly with mactop's exposed HTTP endpoint.
18
+
19
+
- Customizable Data Storage: Supports output to JSON files.
20
+
21
+
- Flexible Data Analysis: Generates summaries of collected metrics.
22
+
23
+
- Lightweight and Efficient: Designed for minimal system overhead
24
+
25
+
26
+
# Prerequisites
27
+
28
+
- mactop: You must have [mactop](https://github.com/context-labs/mactop) installed and running in server mode on your Apple Silicon Mac.
29
+
30
+
- Python: mactop-analyzer requires Python 3.13, and we strongly recommend [uv](https://github.com/astral-sh/uv) to manage environment and packages.
31
+
32
+
- Golang (Optional): We have released binaries for scraper, you can download and run directly. Alternatively, you can build from source code, and go >= 1.24 is recommended.
33
+
34
+
35
+
# Usage
36
+
37
+
## Scraper
38
+
39
+
Scraper is a command-line tool that collects metrics from mactop's HTTP endpoint and stores them in JSON files.
40
+
41
+
Assuming you have downloaded the released binary as `scraper`, you can run it with the following command:
You can find more details about the command-line options by running:
48
+
49
+
```bash
50
+
./scraper --help
51
+
```
52
+
53
+
## Analyzer
54
+
55
+
Analyzer is a Python script that processes the collected JSON files and generates summaries of the metrics.
56
+
57
+
Before running the analyzer, make sure you have installed the required Python packages. You can do this using `uv`:
58
+
59
+
```bash
60
+
uv sync
61
+
```
62
+
63
+
Then, you can run the analyzer with the following command:
64
+
65
+
```bash
66
+
uv run analyzer.py --input-dir "./metrics_data"
67
+
```
68
+
69
+
Then, you can get a report of the collected metrics. You can also get graphs of the metrics by adding `--plot` option.
70
+
71
+
72
+
# License
73
+
74
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
75
+
76
+
77
+
# Contributing
78
+
79
+
Contributions are welcome! Please feel free to submit issues or pull requests. For major changes, please open an issue first to discuss what you would like to change.
0 commit comments