Skip to content

Commit ed0027f

Browse files
initial commit
0 parents  commit ed0027f

20 files changed

+1393
-0
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.gitconfig
2+
3+
# Ignore Gradle project-specific cache directory
4+
.gradle
5+
6+
# Ignore Gradle build output directory
7+
build
8+
9+
# Ignore bin directory
10+
bin
11+
12+
# Ignore Mac stuff
13+
.DS_Store
14+
15+
# Ignore emacs stuff
16+
*~
17+
#*

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Monitor Tutorial
2+
3+
Swim application tutorial to monitor a cluster of machines.
4+
5+
## Getting Started
6+
7+
[Install JDK 11+](https://www.oracle.com/technetwork/java/javase/downloads/index.html)
8+
9+
- Ensure that your `JAVA_HOME` environment variable points to the Java installation.
10+
- Ensure that your `PATH` includes `$JAVA_HOME`.
11+
12+
## Running the Tutorial
13+
14+
### Running the Server
15+
16+
```bash
17+
$ ./gradlew run
18+
```
19+
20+
### Running a Client
21+
22+
```bash
23+
$ ./gradlew -Dhost=<warp-address-of-server> runClient
24+
```
25+
26+
Example:
27+
28+
```bash
29+
$ ./gradlew -Dhost=warp://localhost:9001 runClient
30+
```
31+
32+
## Streaming APIs
33+
34+
### Introspection APIs
35+
36+
#### Stream High level stats
37+
```
38+
swim-cli sync -h warp://localhost:9001 -n swim:meta:mesh -l pulse
39+
```
40+
41+
### Application APIs
42+
43+
#### Streaming APIs for top level Monitor
44+
```
45+
swim-cli sync -h warp://localhost:9001 -n /monitor -l machines
46+
swim-cli sync -h warp://localhost:9001 -n /monitor -l clusters
47+
```
48+
49+
#### Streaming APIs for a given Machine
50+
```
51+
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l status
52+
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l statusHistory
53+
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l systemInfo
54+
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l usage
55+
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l processes
56+
swim-cli sync -h warp://localhost:9001 -n /machine/my-machine -l sessions
57+
```
58+
59+
#### Streaming APIs for a Cluster
60+
```
61+
swim-cli sync -h warp://localhost:9001 -n /cluster/abc -l machines
62+
swim-cli sync -h warp://localhost:9001 -n /cluster/abc -l status
63+
swim-cli sync -h warp://localhost:9001 -n /cluster/abc -l statusHistory
64+
```
65+
66+
## Running the UI
67+
68+
69+
Now, under the `/ui` folder under project root, open `index.html` as a local file in your web browser to see results from monitoring your locate machine populate a chart.

server/build.gradle

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
buildscript { repositories {
2+
maven {
3+
url "https://plugins.gradle.org/m2/"
4+
}
5+
}
6+
}
7+
8+
apply plugin: 'java'
9+
apply plugin: 'application'
10+
11+
sourceCompatibility = JavaVersion.VERSION_11
12+
targetCompatibility = JavaVersion.VERSION_11
13+
14+
15+
group = 'swim'
16+
description = 'Swim Machine Monitoring Application'
17+
version = project.property('application.version')
18+
mainClassName = 'swim.monitor.SwimMonitorPlane'
19+
ext.swimVersion = project.property('swim.version')
20+
ext.moduleName = 'swim.monitor'
21+
ext.moduleArgs = []
22+
23+
repositories {
24+
mavenCentral()
25+
}
26+
27+
dependencies {
28+
implementation group: 'org.swimos', name: 'swim-server', version: swimVersion
29+
implementation group: 'org.swimos', name: 'swim-client', version: swimVersion
30+
implementation group: 'org.swimos', name:'swim-meta', version: swimVersion
31+
implementation 'com.github.oshi:oshi-core:6.1.6'
32+
}
33+
34+
task runClient(type: JavaExec) {
35+
group = "application"
36+
classpath sourceSets.main.runtimeClasspath
37+
mainClass = 'swim.monitor.client.SwimMonitorClient'
38+
systemProperties = System.getProperties()
39+
}
40+
41+
task createClientApp(type: CreateStartScripts) {
42+
mainClass = 'swim.monitor.client.SwimMonitorClient'
43+
classpath = startScripts.classpath
44+
outputDir = startScripts.outputDir
45+
applicationName = 'swim-monitor-client'
46+
defaultJvmOpts = ["-Dhost=warps://monitor.swim.services", "-Dcluster=cloud"]
47+
}
48+
49+
applicationDistribution.into("bin") {
50+
duplicatesStrategy= DuplicatesStrategy.EXCLUDE
51+
from(createClientApp)
52+
fileMode = 0755
53+
}

server/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
application.version=1.0.0
2+
swim.version=4.0.1
60.6 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
4+
networkTimeout=10000
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)