Skip to content

Commit 314fa50

Browse files
author
Ariane van der Steldt
committed
opensource.
0 parents  commit 314fa50

File tree

369 files changed

+43039
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+43039
-0
lines changed

.ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
environment:
2+
language: java
3+
language_versions: 1.8.0_60
4+
packages:
5+
- apache_maven-3.1.1
6+
- npm_npm-2015.02.27_20.23
7+
- node-v6.1.0
8+
build:
9+
run: mvn -U clean deploy

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
target
2+
dependency-reduced-pom.xml
3+
4+
.project
5+
.settings
6+
.classpath
7+
8+
# IntelliJ project directories
9+
**/*.idea
10+
**/*.iml

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Copyright (c) 2016, Groupon, Inc.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions
6+
are met:
7+
8+
Redistributions of source code must retain the above copyright notice,
9+
this list of conditions and the following disclaimer.
10+
11+
Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
13+
documentation and/or other materials provided with the distribution.
14+
15+
Neither the name of GROUPON nor the names of its contributors may be
16+
used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
20+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
25+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Mon-soon
2+
====
3+
4+
An extensible monitor system that checks java processes and exposes metrics based on them.
5+
6+
The project is extensible and allows for new datasources to be created, so it's not just Java it can monitor.
7+
8+
It should be easy to implement a new processor, to direct monitored data to systems other than monitord.
9+
10+
Usage
11+
----
12+
13+
The system uses processors to hook up to external metric and alerting systems.
14+
Processors are what turns the system from a pile of code into a useful component of your production deployment.
15+
16+
Configuration
17+
----
18+
19+
Please refer to the [configuration documentation](doc/config.md).
20+
21+
----
22+
23+
Prometheus Integration
24+
----
25+
26+
The Prometheus exporter will take all jmx metrics and convert them to a format that Prometheus can scrap
27+
[prometheus.jar](doc/prometheus/README.md).
28+
29+
30+
31+
Development
32+
----
33+
34+
Development documentation has its [own section](doc/dev/README.md).

api_server/pom.xml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<parent>
4+
<groupId>com.groupon.lex</groupId>
5+
<artifactId>monsoon-basepom</artifactId>
6+
<version>1.35-SNAPSHOT</version>
7+
</parent>
8+
<artifactId>monsoon-api</artifactId>
9+
<packaging>jar</packaging>
10+
<name>Mon-soon api server</name>
11+
<url>https://github.com/groupon/monsoon</url>
12+
13+
<scm>
14+
<connection>scm:git:github.com:groupon/monsoon.git</connection>
15+
<developerConnection>scm:git:github.com:groupon/monsoon.git</developerConnection>
16+
<url>https://github.com/groupon/monsoon</url>
17+
<tag>HEAD</tag>
18+
</scm>
19+
20+
<properties>
21+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
22+
<maven.javadoc.skip>true</maven.javadoc.skip>
23+
<project.build.targetJdk>1.8</project.build.targetJdk>
24+
</properties>
25+
26+
<dependencies>
27+
<dependency>
28+
<groupId>com.groupon.lex</groupId>
29+
<artifactId>monsoon-collector-base</artifactId>
30+
<version>${project.parent.version}</version>
31+
</dependency>
32+
<dependency>
33+
<groupId>com.groupon.lex</groupId>
34+
<artifactId>monsoon-lib</artifactId>
35+
<version>${project.parent.version}</version>
36+
</dependency>
37+
<dependency>
38+
<groupId>joda-time</groupId>
39+
<artifactId>joda-time</artifactId>
40+
<version>2.8</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.eclipse.jetty</groupId>
44+
<artifactId>jetty-server</artifactId>
45+
<version>${jetty.version}</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>org.eclipse.jetty</groupId>
49+
<artifactId>jetty-servlet</artifactId>
50+
<version>${jetty.version}</version>
51+
</dependency>
52+
</dependencies>
53+
54+
<build>
55+
<finalName>${project.artifactId}</finalName>
56+
<resources>
57+
<resource>
58+
<directory>src/main/resources</directory>
59+
<filtering>false</filtering>
60+
</resource>
61+
<resource>
62+
<directory>target/npm</directory>
63+
<filtering>false</filtering>
64+
</resource>
65+
</resources>
66+
<plugins>
67+
<plugin>
68+
<groupId>org.apache.maven.plugins</groupId>
69+
<artifactId>maven-compiler-plugin</artifactId>
70+
<version>3.2</version>
71+
<configuration>
72+
<source>1.8</source>
73+
<target>1.8</target>
74+
<compilerReuseStrategy>alwaysNew</compilerReuseStrategy>
75+
</configuration>
76+
</plugin>
77+
<plugin>
78+
<groupId>org.apache.maven.plugins</groupId>
79+
<artifactId>maven-javadoc-plugin</artifactId>
80+
<version>2.10.3</version>
81+
<configuration>
82+
<source>1.8</source>
83+
</configuration>
84+
</plugin>
85+
<plugin>
86+
<groupId>org.apache.maven.plugins</groupId>
87+
<artifactId>maven-jar-plugin</artifactId>
88+
<version>2.6</version>
89+
<configuration>
90+
<archive>
91+
<index>true</index>
92+
</archive>
93+
</configuration>
94+
</plugin>
95+
<!-- Copy NPM sources pre-compilation. -->
96+
<plugin>
97+
<artifactId>maven-resources-plugin</artifactId>
98+
<version>2.7</version>
99+
<executions>
100+
<execution>
101+
<id>copy-resources</id>
102+
<!-- here the phase you need -->
103+
<phase>generate-sources</phase>
104+
<goals>
105+
<goal>copy-resources</goal>
106+
</goals>
107+
<configuration>
108+
<outputDirectory>target/npm/www</outputDirectory>
109+
<resources>
110+
<resource>
111+
<directory>src/main/frontend</directory>
112+
<filtering>false</filtering>
113+
<excludes>
114+
<exclude>node_modules/**</exclude>
115+
<exclude>typings/**</exclude>
116+
<exclude>app/*.js</exclude>
117+
<exclude>app/*.js.map</exclude>
118+
</excludes>
119+
</resource>
120+
</resources>
121+
</configuration>
122+
</execution>
123+
</executions>
124+
</plugin>
125+
<plugin>
126+
<groupId>org.codehaus.mojo</groupId>
127+
<artifactId>exec-maven-plugin</artifactId>
128+
<executions>
129+
<execution>
130+
<id>exec-npm-install</id>
131+
<phase>generate-sources</phase>
132+
<configuration>
133+
<executable>npm</executable>
134+
<workingDirectory>target/npm/www</workingDirectory>
135+
<arguments>
136+
<argument>install</argument>
137+
</arguments>
138+
</configuration>
139+
<goals>
140+
<goal>exec</goal>
141+
</goals>
142+
</execution>
143+
<execution>
144+
<id>exec-npm-tsc</id>
145+
<phase>generate-sources</phase>
146+
<configuration>
147+
<executable>npm</executable>
148+
<workingDirectory>target/npm/www</workingDirectory>
149+
<arguments>
150+
<argument>run-script</argument>
151+
<argument>tsc</argument>
152+
</arguments>
153+
</configuration>
154+
<goals>
155+
<goal>exec</goal>
156+
</goals>
157+
</execution>
158+
</executions>
159+
</plugin>
160+
</plugins>
161+
</build>
162+
</project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
typings
3+
app/*.js
4+
app/**/*.js
5+
app/**/*.js.map
6+
npm-debug.log
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { Component, ViewChild } from '@angular/core';
2+
import { Router, Routes, ROUTER_DIRECTIVES } from '@angular/router';
3+
import { ChartEditComponent } from './chart/chart-edit.component';
4+
import { ChartViewComponent } from './chart/chart-view.component';
5+
import { ChartEditArgumentsService } from './chart/chart-edit-arguments.service';
6+
import { ChartTimeSpecModalComponent } from './chart/chart-time-spec-modal.component';
7+
8+
9+
@Component({
10+
selector: 'my-app',
11+
directives: [ROUTER_DIRECTIVES, ChartTimeSpecModalComponent],
12+
providers: [ChartEditArgumentsService],
13+
styles: [`
14+
.my-app {
15+
width: 100%;
16+
height: 100%;
17+
}
18+
.content-fill {
19+
width: 100%;
20+
height: 100%;
21+
margin-top: -72px;
22+
padding-top: 72px;
23+
}
24+
`],
25+
template: `
26+
<nav class="navbar navbar-default">
27+
<div class="container-fluid">
28+
<div class="navbar-header">
29+
<a class="navbar-brand" href="#">Mon-soon</a>
30+
</div>
31+
<div id="navbar" class="navbar-collapse collapse">
32+
<ul class="nav navbar-nav">
33+
<li><a [routerLink]="['/fe/chart-edit', chartEditArguments.value]">Edit Chart</a></li>
34+
</ul>
35+
<ul class="nav navbar-nav navbar-right">
36+
<li><a href="#" (click)="_chartTimeSpecModal($event)">Change Time</a></li>
37+
</ul>
38+
</div>
39+
</div>
40+
</nav>
41+
<div class="content-fill">
42+
<router-outlet></router-outlet>
43+
</div>
44+
<chart-time-spec-modal #chartTimeSpecModal></chart-time-spec-modal>
45+
`
46+
})
47+
@Routes([
48+
{ path: '/fe/chart-edit', component: ChartEditComponent },
49+
{ path: '/fe/chart-view', component: ChartViewComponent }
50+
])
51+
export class AppComponent {
52+
@ViewChild('chartTimeSpecModal')
53+
chartTimeSpecModal: ChartTimeSpecModalComponent;
54+
55+
constructor(private router: Router,
56+
private chartEditArguments: ChartEditArgumentsService) {
57+
}
58+
59+
_chartTimeSpecModal(event) {
60+
event.preventDefault();
61+
this.chartTimeSpecModal.open();
62+
}
63+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { EventEmitter, Injectable, Input, Output } from '@angular/core';
2+
3+
@Injectable()
4+
export class ChartEditArgumentsService {
5+
private _cur: Map<string, string> = new Map<string, string>();
6+
7+
@Output('value')
8+
value_event : EventEmitter<Map<string, string>> = new EventEmitter<Map<string, string>>();
9+
10+
@Input('value')
11+
set value(exprs: Map<string, string>) {
12+
this._cur = exprs;
13+
this.value_event.next(exprs);
14+
}
15+
get value(): Map<string, string> {
16+
return this._cur;
17+
}
18+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { Component } from '@angular/core';
2+
import { ChartExprFormComponent } from './chart-expr-form.component';
3+
import { ChartExpr } from './chart-expr';
4+
import { OnActivate, Router, RouteSegment, RouteTree } from '@angular/router';
5+
6+
7+
@Component({
8+
selector: 'chart-edit',
9+
directives: [ChartExprFormComponent],
10+
styles: [`
11+
.chart-edit {
12+
width: 100%;
13+
height: 100%;
14+
}
15+
`],
16+
template: `
17+
<h1>Monsoon Chart</h1>
18+
<chart-expr-form #form (expr)="onRender($event)" [initial]="exprs"></chart-expr-form>
19+
`
20+
})
21+
export class ChartEditComponent implements OnActivate {
22+
private exprs: Map<string, string> = new Map<string, string>();
23+
24+
constructor(private router: Router) {}
25+
26+
routerOnActivate(curr: RouteSegment, prev?: RouteSegment, currTree?: RouteTree, prevTree?: RouteTree): void {
27+
let exprs: Map<string, string> = new Map<string, string>();
28+
29+
Object.keys(curr.parameters).forEach((enc_k) => {
30+
let k: string = decodeURIComponent(enc_k);
31+
let v: string = decodeURIComponent(curr.getParam(enc_k));
32+
if (k.startsWith("expr:")) {
33+
exprs[k.substr(5)] = v;
34+
}
35+
});
36+
this.exprs = exprs;
37+
}
38+
39+
onRender(m: ChartExpr) {
40+
let args = {};
41+
Object.keys(m.expr).forEach((k) => {
42+
args[this._encode('expr:' + k)] = this._encode(m.expr[k]);
43+
});
44+
45+
this.router.navigate(['/fe/chart-view', args]);
46+
}
47+
48+
_encode(s: string): string {
49+
// Angular cannot handle round brackets in its argument. :'(
50+
return encodeURIComponent(s).replace(/\(/g, '%28').replace(/\)/g, '%29');
51+
}
52+
}

0 commit comments

Comments
 (0)