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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monitor Tutorial

Swim application tutorial to monitor a cluster of machines.

Getting Started

Install JDK 11+

  • 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

$ ./gradlew run

Running a Client

$ ./gradlew -Dhost=<warp-address-of-server> runClient

Example:

$ ./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.

About

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.


Languages

Language:Java 91.4%Language:HTML 8.6%