https://github.com/swimos/tutorial-monitor
This is tutorial source code for a process monitoring client-server example that provides data for individual machines in a cluster, as well as aggregate metrics for the cluster.
https://github.com/swimos/tutorial-monitor
Last synced: 5 months ago
JSON representation
This is tutorial source code for a process monitoring client-server example that provides data for individual machines in a cluster, as well as aggregate metrics for the cluster.
- Host: GitHub
- URL: https://github.com/swimos/tutorial-monitor
- Owner: swimos
- Created: 2023-11-10T20:13:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-21T19:08:28.000Z (almost 2 years ago)
- Last Synced: 2025-05-13T00:45:35.472Z (5 months ago)
- Language: Java
- Size: 74.2 KB
- Stars: 0
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Monitor Tutorial
Swim application tutorial to monitor a cluster of machines.
## Getting Started
[Install JDK 11+](https://www.oracle.com/technetwork/java/javase/downloads/index.html)
- Ensure that your `JAVA_HOME` environment variable points to the Java installation.
- Ensure that your `PATH` includes `$JAVA_HOME`.## Running the Tutorial
### Running the Server
```bash
$ ./gradlew run
```### Running a Client
```bash
$ ./gradlew -Dhost= runClient
```Example:
```bash
$ ./gradlew -Dhost=warp://localhost:9001 runClient
```## Streaming APIs
### Introspection APIs
#### Stream High level stats
```
swim-cli sync -h warp://localhost:9001 -n swim:meta:mesh -l pulse
```### Application APIs
#### Streaming APIs for top level Monitor
```
swim-cli sync -h warp://localhost:9001 -n /monitor -l machines
swim-cli sync -h warp://localhost:9001 -n /monitor -l clusters
```#### Streaming APIs for a given Machine
```
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l status
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l statusHistory
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l systemInfo
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l usage
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l processes
```#### Streaming APIs for a Cluster
```
swim-cli sync -h warp://localhost:9001 -n /cluster/abc -l machines
swim-cli sync -h warp://localhost:9001 -n /cluster/abc -l status
swim-cli sync -h warp://localhost:9001 -n /cluster/abc -l statusHistory
```## Running the UI
Now, you can view the UI by appending `/ui` to the host address using the HTTP or HTTPS protocol, such as `http://localhost:9001/ui`.