Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ subprojects {
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.hierynomus.license'

version = "0.2-beta-2"
version = "0.2"

license {
includes(["**/*.java", "**/*.groovy"])
Expand Down
8 changes: 4 additions & 4 deletions chronix-importer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ dependencies {
compile 'org.yaml:snakeyaml:1.17'

compile 'de.qaware.chronix:chronix-api:0.1'
compile 'de.qaware.chronix:chronix-server-client:0.2-beta-1'
compile 'de.qaware.chronix:chronix-kassiopeia-simple:0.1.8-beta-4'
compile 'de.qaware.chronix:chronix-kassiopeia-simple-converter:0.1.8-beta-4'
compile 'de.qaware.chronix:chronix-server-client:0.2'
compile 'de.qaware.chronix:chronix-kassiopeia-simple:0.2'
compile 'de.qaware.chronix:chronix-kassiopeia-simple-converter:0.2'

//Testing
testCompile 'org.codehaus.groovy:groovy-all:2.4.6'
Expand All @@ -30,5 +30,5 @@ jar {

task buildRelease(type: Copy) {
into "$projectDir/release/lib"
from "$buildDir/libs/chronix-importer-0.2-beta-1.jar"
from "$buildDir/libs/chronix-importer-0.2.jar"
}
2 changes: 1 addition & 1 deletion chronix-importer/release/import.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

java -Dlog4j.configurationFile=log4j2.xml -jar lib/chronix-importer-0.2-beta-1.jar config.yml data/
java -Dlog4j.configurationFile=log4j2.xml -jar lib/chronix-importer-0.2.jar config.yml data/
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import de.qaware.chronix.converter.serializer.gen.SimpleProtocolBuffers;
import de.qaware.chronix.solr.client.ChronixSolrStorage;
import de.qaware.chronix.timeseries.MetricTimeSeries;
import de.qaware.chronix.timeseries.dt.Point;
import de.qaware.chronix.timeseries.Point;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException;
Expand Down
12 changes: 6 additions & 6 deletions chronix-server-integration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ dependencies {

//Chronix
compile 'de.qaware.chronix:chronix-api:0.1'
compile 'de.qaware.chronix:chronix-server-client:0.1.3'
compile 'de.qaware.chronix:chronix-server-client:0.2'

//Kassiopeia-Simple
compile 'de.qaware.chronix:chronix-kassiopeia-simple:0.1.7'
compile 'de.qaware.chronix:chronix-kassiopeia-simple-converter:0.1.7'
compile 'de.qaware.chronix:chronix-kassiopeia-simple:0.2'
compile 'de.qaware.chronix:chronix-kassiopeia-simple-converter:0.2'

//Kassiopeia
compile 'de.qaware.chronix:chronix-kassiopeia:0.1.7'
compile 'de.qaware.chronix:chronix-kassiopeia-converter:0.1.7'
compile 'de.qaware.chronix:chronix-kassiopeia:0.2'
compile 'de.qaware.chronix:chronix-kassiopeia-converter:0.2'

//Solr
compile 'org.apache.solr:solr-solrj:5.5.0'
compile 'org.apache.solr:solr-solrj:6.0.1'

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

/**
* An example showcase of how to integrate chronix into your application.
* Works with the release 0.1.1 of the chronix-server
* Works with the release 0.2 of the chronix-server
* Download at <a href="https://github.com/ChronixDB/chronix.server/releases/download/v0.1/chronix-0.1.zip">chronix-server-0.1.1</a>
* Note: The example data stored in the release
*
Expand All @@ -59,7 +59,7 @@ public static void main(String[] args) {

//We want the maximum of all time series that metric matches *load*.
SolrQuery query = new SolrQuery("metric:*Load*");
query.addFilterQuery("ag=max");
query.addFilterQuery("function=max");

//The result is a Java Stream. We simply collect the result into a list.
List<TimeSeries<Long, Double>> maxTS = chronix.stream(solr, query).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import de.qaware.chronix.ChronixClient;
import de.qaware.chronix.converter.KassiopeiaSimpleConverter;
import de.qaware.chronix.converter.common.DoubleList;
import de.qaware.chronix.converter.common.LongList;
import de.qaware.chronix.solr.client.ChronixSolrStorage;
import de.qaware.chronix.timeseries.MetricTimeSeries;
import de.qaware.chronix.timeseries.dt.DoubleList;
import de.qaware.chronix.timeseries.dt.LongList;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
Expand All @@ -34,7 +34,7 @@

/**
* An example showcase of how to integrate chronix into your application using kassiopeia-simple
* Works with the release 0.1.1 of the chronix-server
* Works with the release 0.2 of the chronix-server
* Download at <a href="https://github.com/ChronixDB/chronix.server/releases/download/v0.1.1/chronix-0.1.1.zip">chronix-server-0.1.1</a>
*
* @author f.lautenschlager
Expand Down Expand Up @@ -64,7 +64,7 @@ public static void main(String[] args) {

//We want the maximum of all time series that metric matches *load*.
SolrQuery query = new SolrQuery("metric:*Load*");
query.addFilterQuery("ag=max");
query.addFilterQuery("function=max");

//The result is a Java Stream. We simply collect the result into a list.
List<MetricTimeSeries> maxTS = chronix.stream(solr, query).collect(Collectors.toList());
Expand Down
8 changes: 4 additions & 4 deletions chronix-timeseries-exploration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ To start you have to do a few steps:
First ensure that you have a Java 8 runtime environment in your PATH.
That should be easy ;-).

Then download, unzip and start the [Chronix Server](https://github.com/ChronixDB/chronix.server/releases/tag/v0.0.2).
Then download, unzip and start the [Chronix Server](https://github.com/ChronixDB/chronix.server/releases/tag/0.2).
```
wget https://github.com/ChronixDB/chronix.server/releases/download/v0.1.1/chronix-0.1.1.zip
unzip chronix-0.1.1.zip
wget https://github.com/ChronixDB/chronix.server/releases/download/0.2/chronix-0.2.zip
unzip chronix-0.2.zip

./chronix-solr-5.4.0/bin/solr start
./chronix-solr-6.0.4/bin/solr start
Waiting up to 30 seconds to see Solr running on port 8983 [|]
Started Solr server on port 8983 (pid=2504). Happy searching!
```
Expand Down
6 changes: 3 additions & 3 deletions chronix-timeseries-exploration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ dependencies {
compile 'commons-logging:commons-logging:1.2'

compile 'de.qaware.chronix:chronix-api:0.1'
compile 'de.qaware.chronix:chronix-server-client:0.2-beta-1'
compile 'de.qaware.chronix:chronix-kassiopeia-simple:0.1.8-beta-4'
compile 'de.qaware.chronix:chronix-kassiopeia-simple-converter:0.1.8-beta-4'
compile 'de.qaware.chronix:chronix-server-client:0.2'
compile 'de.qaware.chronix:chronix-kassiopeia-simple:0.2'
compile 'de.qaware.chronix:chronix-kassiopeia-simple-converter:0.2'
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,23 @@
import de.qaware.chronix.ChronixClient;
import de.qaware.chronix.converter.KassiopeiaSimpleConverter;
import de.qaware.chronix.examples.exploration.ui.dt.DateAxis;
import de.qaware.chronix.examples.exploration.ui.dt.ResultRow;
import de.qaware.chronix.examples.exploration.ui.log.TextAreaLogger;
import de.qaware.chronix.solr.client.ChronixSolrStorage;
import de.qaware.chronix.timeseries.MetricTimeSeries;
import de.qaware.chronix.timeseries.dt.Point;
import de.qaware.chronix.timeseries.Point;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.concurrent.Task;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextArea;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
Expand Down Expand Up @@ -76,6 +81,24 @@ public class MainController implements Initializable {
@FXML
private LineChart<DateAxis, NumberAxis> chart;

/**
* Table stuff below
*/
@FXML
private TableView<ResultRow> resultTable;
@FXML
private TableColumn<ResultRow, String> timeSeries;
@FXML
private TableColumn<ResultRow, String> aggregationOrAnalysis;
@FXML
private TableColumn<ResultRow, String> arguments;
@FXML
private TableColumn<ResultRow, String> values;
@FXML
private TableColumn<ResultRow, String> order;

private ObservableList<ResultRow> rows = FXCollections.observableArrayList();

//Chronix stuff
private ChronixClient<MetricTimeSeries, SolrClient, SolrQuery> chronix;
private SolrClient solr;
Expand All @@ -87,6 +110,14 @@ public void initialize(URL location, ResourceBundle resources) {
//Pipe logs to ui
TextAreaLogger.setTextArea(logs);

//Init table
timeSeries.setCellValueFactory(cellData -> cellData.getValue().timeSeriesProperty());
aggregationOrAnalysis.setCellValueFactory(cellData -> cellData.getValue().aggregationOrAnalysisProperty());
arguments.setCellValueFactory(cellData -> cellData.getValue().argumentsProperty());
values.setCellValueFactory(cellData -> cellData.getValue().valuesProperty());
order.setCellValueFactory(cellData -> cellData.getValue().orderProperty());
resultTable.setItems(rows);

EventHandler<KeyEvent> queryExecuteHandler = event -> {
if (event.getCode() == KeyCode.ENTER && event.isShiftDown()) {
queryTimeSeries();
Expand Down Expand Up @@ -146,19 +177,18 @@ protected Void call() throws Exception {

Platform.runLater(() -> {
chart.getData().clear();
rows.clear();
//Start the query
chart.setTitle("Your Query was q=" + queryString + " fq=" + fq);
});

SolrQuery query = new SolrQuery(queryString);
query.addField("+data");

boolean hasFilterQueries = !fq.isEmpty();

if (hasFilterQueries) {
query.addFilterQuery(fq);

if (fq.contains("analysis=")) {
query.addField("+data");
}
}

long queryStart = System.currentTimeMillis();
Expand All @@ -167,12 +197,10 @@ protected Void call() throws Exception {
LOGGER.info("Query took: {} ms for {} points", (queryEnd - queryStart), size(result));
queryStart = System.currentTimeMillis();
result.forEach(ts -> {

if (hasFilterQueries) {
convertAggregationOrAnalysisTs(ts, fq.contains("analysis="));
} else {
convertTsToSeries(ts);
addFunctionsToTable(ts);
}
convertTsToSeries(ts);
});
queryEnd = System.currentTimeMillis();
LOGGER.info("Charting took: {} ms", (queryEnd - queryStart));
Expand All @@ -183,47 +211,32 @@ protected Void call() throws Exception {

}

private void convertAggregationOrAnalysisTs(MetricTimeSeries ts, boolean analysis) {
private void addFunctionsToTable(MetricTimeSeries ts) {

//find the aggregations / and analyses

ts.getAttributesReference().forEach((key, value) -> {
//we have function value
if (key.contains("function") && !key.contains("arguments")) {
String[] splits = key.split("_");
XYChart.Series<DateAxis, NumberAxis> series = new XYChart.Series<>();

//function name
String name = splits[1];
series.setName(join(ts) + "-" + name);

//function value
if (analysis) {
ts.sort();
List<Point> points;
if (ts.size() > 200_000) {
points = ts.points().filter(point -> point.getIndex() % 1000 == 0).collect(Collectors.toList());
} else {
points = ts.points().collect(Collectors.toList());
}
//reduce the amount shown in the chart we add every 100ths point
addPointsToSeries(series, points);
Platform.runLater(() -> chart.getData().add(series));
String name = splits[2];

//Check if the function has an argument
Object arguments = ts.attribute(splits[0] + "_" + splits[1] + "_arguments_" + splits[2]);

} else {
Instant start = Instant.ofEpochMilli(ts.getStart());
Instant end = Instant.ofEpochMilli(ts.getEnd());

series.getData().add(new XYChart.Data(start, value));
series.getData().add(new XYChart.Data(end, value));
Platform.runLater(() -> chart.getData().add(series));
ResultRow row = new ResultRow();
row.setTimeSeries(join(ts));
row.setAggregationOrAnalysis(name);
if (arguments != null) {
row.setArguments(arguments.toString());
}
row.setValues(value.toString());
row.setOrder(key);


} else {
//function arguments
//currently ignored
rows.add(row);
}


Expand Down Expand Up @@ -276,7 +289,7 @@ private String join(MetricTimeSeries ts) {
if (ts == null) {
return "";
}
return String.valueOf(ts.attribute("host")) + "-" +
return ts.attribute("host") + "-" +
ts.attribute("source") + "-" +
ts.attribute("group") + "-" +
ts.getMetric();
Expand Down
Loading