Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.

Commit ce7d468

Browse files
author
Florian Lautenschlager
committed
Initial commit of the java fx showcase.
1 parent 476000a commit ce7d468

File tree

18 files changed

+1601
-2
lines changed

18 files changed

+1601
-2
lines changed

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Created by https://www.gitignore.io/api/java,intellij,gradle
2+
3+
### Java ###
14
*.class
25

36
# Mobile Tools for Java (J2ME)
@@ -10,3 +13,66 @@
1013

1114
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
1215
hs_err_pid*
16+
17+
18+
### Intellij ###
19+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
20+
21+
*.iml
22+
23+
## Directory-based project format:
24+
.idea/
25+
# if you remove the above rule, at least ignore the following:
26+
27+
# User-specific stuff:
28+
# .idea/workspace.xml
29+
# .idea/tasks.xml
30+
# .idea/dictionaries
31+
32+
# Sensitive or high-churn files:
33+
# .idea/dataSources.ids
34+
# .idea/dataSources.xml
35+
# .idea/sqlDataSources.xml
36+
# .idea/dynamic.xml
37+
# .idea/uiDesigner.xml
38+
39+
# Gradle:
40+
# .idea/gradle.xml
41+
# .idea/libraries
42+
43+
# Mongo Explorer plugin:
44+
# .idea/mongoSettings.xml
45+
46+
## File-based project format:
47+
*.ipr
48+
*.iws
49+
50+
## Plugin-specific files:
51+
52+
# IntelliJ
53+
/out/
54+
55+
# mpeltonen/sbt-idea plugin
56+
.idea_modules/
57+
58+
# JIRA plugin
59+
atlassian-ide-plugin.xml
60+
61+
# Crashlytics plugin (for Android Studio and IntelliJ)
62+
com_crashlytics_export_strings.xml
63+
crashlytics.properties
64+
crashlytics-build.properties
65+
66+
67+
### Gradle ###
68+
.gradle
69+
build/
70+
71+
# Ignore Gradle GUI config
72+
gradle-app.setting
73+
74+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
75+
!gradle-wrapper.jar
76+
77+
###Ingore the data folder
78+
data

.idea/compiler.xml

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
# chronix-examples
2-
Some usefull examples with Chronix
1+
# The Chronix Examples Repository
2+
The repository contains some example showcases of Chronix.
3+
4+
## Time Series Exploration with Chronix
5+
An example showcases based on JavaFX and the default binary release of Chronix. [Jump To](https://github.com/ChronixDB/chronix.examples)
6+
7+
![Image of Chronix JavaFX Example](https://bintray.com/artifact/download/chronix/Images/2015-11-25%2016_08_50-Chronix%20JavaFX%20Example.png)

build.gradle

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*
2+
* Copyright (C) 2015 QAware GmbH
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
buildscript {
18+
repositories {
19+
jcenter()
20+
mavenCentral()
21+
maven {
22+
url "https://plugins.gradle.org/m2/"
23+
}
24+
}
25+
dependencies {
26+
classpath 'com.gradle.publish:plugin-publish-plugin:0.9.1'
27+
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
28+
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0'
29+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
30+
}
31+
}
32+
33+
allprojects {
34+
apply plugin: 'jacoco'
35+
apply plugin: 'com.github.kt3k.coveralls'
36+
37+
38+
39+
group 'de.qaware.chronix'
40+
41+
repositories {
42+
jcenter()
43+
mavenCentral()
44+
maven {
45+
url "http://dl.bintray.com/chronix/maven"
46+
}
47+
}
48+
49+
jacoco {
50+
toolVersion = '0.7.2.201409121644'
51+
}
52+
}
53+
54+
subprojects {
55+
apply plugin: 'base'
56+
apply plugin: 'groovy'
57+
apply plugin: 'java'
58+
apply plugin: 'com.github.hierynomus.license'
59+
apply plugin: 'maven-publish'
60+
apply plugin: 'com.gradle.plugin-publish'
61+
apply plugin: 'com.jfrog.bintray'
62+
63+
license {
64+
includes(["**/*.java", "**/*.groovy"])
65+
mapping {
66+
java = 'SLASHSTAR_STYLE'
67+
groovy = 'SLASHSTAR_STYLE'
68+
}
69+
}
70+
71+
sourceCompatibility = JavaVersion.VERSION_1_8
72+
targetCompatibility = JavaVersion.VERSION_1_8
73+
74+
dependencies {
75+
//Logging
76+
compile 'org.slf4j:slf4j-api:1.7.12'
77+
compile 'org.slf4j:jcl-over-slf4j:1.7.12'
78+
compile 'org.apache.logging.log4j:log4j-api:2.4'
79+
compile 'org.apache.logging.log4j:log4j-core:2.4'
80+
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.4'
81+
}
82+
83+
84+
test {
85+
reports {
86+
junitXml.enabled = false
87+
html.enabled = true
88+
}
89+
}
90+
91+
// This disables the pedantic doclint feature of JDK8
92+
if (JavaVersion.current().isJava8Compatible()) {
93+
tasks.withType(Javadoc) {
94+
options.addStringOption('Xdoclint:none', '-quiet')
95+
}
96+
}
97+
98+
task sourcesJar(type: Jar, dependsOn: classes) {
99+
classifier = 'sources'
100+
from sourceSets.main.allSource
101+
}
102+
103+
jacocoTestReport {
104+
group = 'Coverage'
105+
description = 'Generate Jacoco coverage report for subproject'
106+
107+
additionalSourceDirs = project.files(sourceSets.main.allSource.srcDirs)
108+
sourceDirectories = project.files(sourceSets.main.allSource.srcDirs)
109+
classDirectories = project.files(sourceSets.main.output)
110+
111+
reports {
112+
xml.enabled = true
113+
html.enabled = true
114+
}
115+
}
116+
}
117+
118+
119+
task jacocoRootReport(type: JacocoReport, group: 'Coverage') {
120+
description = 'Generates aggregate Jacoco coverage report from all subprojects'
121+
dependsOn(subprojects.test)
122+
123+
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
124+
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
125+
classDirectories = files(subprojects.sourceSets.main.output)
126+
executionData = files(subprojects.jacocoTestReport.executionData)
127+
128+
reports {
129+
html.enabled = true
130+
xml.enabled = true
131+
}
132+
133+
doFirst {
134+
executionData = files(executionData.findAll { it.exists() })
135+
}
136+
}
137+
138+
coveralls {
139+
sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
140+
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
141+
}
142+
143+
def isCI = System.env.'CI' == 'true'
144+
tasks.coveralls {
145+
group = 'Coverage'
146+
description = 'Upload aggregate Jacoco coverage report to Coveralls'
147+
148+
dependsOn jacocoRootReport
149+
onlyIf { isCI }
150+
}
151+
152+
task wrapper(type: Wrapper) {
153+
gradleVersion = '2.4'
154+
}
155+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (C) 2015 QAware GmbH
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Time Series Exploration with Chronix
2+
This example shows how Chronix can be plugged into a rich client application.
3+
The example is a simple ui with a line chart and a two text fields for enter Chronix range and analysis queries.
4+
It uses a central Chronix Server to query the time series.
5+
##### Screenshot of the JavaFX Example
6+
![Image of Chronix JavaFX Example](https://bintray.com/artifact/download/chronix/Images/2015-11-25%2016_08_50-Chronix%20JavaFX%20Example.png)
7+
8+
## How to start?
9+
To start you have to do a few steps:
10+
11+
### Prerequisites
12+
1. JDK 8
13+
2. Chronix Server
14+
15+
### Download and execution
16+
First ensure that you have a Java 8 runtime environment in your PATH.
17+
That should be easy ;-).
18+
19+
Then download, unzip and start the [Chronix Server](https://github.com/ChronixDB/chronix.server/releases/tag/v0.0.2).
20+
```
21+
wget https://github.com/ChronixDB/chronix.server/releases/download/v0.0.2/chronix-0.0.2.zip
22+
unzip chronix-0.0.2.zip
23+
24+
./chronix-solr-5.3.1/bin/solr start
25+
Waiting up to 30 seconds to see Solr running on port 8983 [|]
26+
Started Solr server on port 8983 (pid=2504). Happy searching!
27+
```
28+
So lets download and execute the JavaFX application.
29+
30+
You can download the example application on GitHub [ChronixDB Examples Releases](https://github.com/ChronixDB/chronix.examples/releases).
31+
Copy the example to a directory of your choice, e.g., /home/chronix/examples/javaFXExample.jar and execute it.
32+
33+
```Shell
34+
35+
cd <Your-Download-Directory>
36+
java -jar chronix-timeseries-exploration.jar
37+
```
38+
You should then see the application shown in the screenshot, but with an empty chart.
39+
In the right lower corner you will find a small circle that indicates if the application is connected to Chronix.
40+
- Green says: YES
41+
- Red says: NO
42+
43+
So if the state is green, everything is fine. Time to execute a few queries!
44+
## Some details about the time series data
45+
The data set used for this example is one week of operational time series data.
46+
47+
| Fields | Values |
48+
| ------------- |:-------------------------- |
49+
| host | prod39 |
50+
| source | os |
51+
| group | unix |
52+
| metric | "Unix Top metrics" |
53+
| start | 26.08.2013 00:00:17.361 |
54+
| end | 01.09.2013 23:59:18.096 |
55+
56+
## Some example queries
57+
The first text area is for range queries.
58+
The second text area is for filter queries (e.g. analyses like ag=max, analysis=trend)
59+
```JSON
60+
#Get the average load (metric) on day 28.08.2013
61+
Range Query: metric:\\Load\\avg AND start:2013-08-28T00:00:00.000Z AND end:2013-08-29T23:59:59.999Z
62+
63+
#Get the maximum of the load (metric) on day 28.08.2013
64+
Range Query: metric:\\Load\\avg AND start:2013-08-28T00:00:00.000Z AND end:2013-08-29T23:59:59.999Z
65+
Filter Query: ag=max
66+
```

0 commit comments

Comments
 (0)