An open API service indexing awesome lists of open source software.

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.

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`.