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

Some Fixes. #77

Merged
merged 16 commits into from
Oct 4, 2016
Merged

Some Fixes. #77

merged 16 commits into from
Oct 4, 2016

Conversation

FlorianLautenschlager
Copy link
Member

No description provided.

@FlorianLautenschlager FlorianLautenschlager changed the title Fixes #76 Some Fixes. Oct 1, 2016
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling c8305c5 on FlorianLautenschlager:master into 9db9766 on ChronixDB:master.

@Override
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
//Check: https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers
//TODO: Handle the request
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: Comment matches to-do format 'TODO:'.


//2) Converter to time series
MetricTimeSeries ts = new MetricTimeSeries.Builder("cpu_load_short")
.attribute("host","server02")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: ',' is not followed by whitespace.

//2) Converter to time series
MetricTimeSeries ts = new MetricTimeSeries.Builder("cpu_load_short")
.attribute("host","server02")
.attribute("region","us-west")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: ',' is not followed by whitespace.

@@ -213,12 +212,12 @@ private static boolean hasTransformationsOrAggregations(FunctionValueMap functio
* @throws ParseException if bad things happen
* @throws IOException if bad things happen
*/
private void applyAnalyses(SolrQueryRequest req, Iterable<ChronixAnalysis<MetricTimeSeries>> analyses, Function<SolrDocument, String> key, long queryStart, long queryEnd, Map.Entry<String, List<SolrDocument>> docs, MetricTimeSeries timeSeries, FunctionValueMap analysisAndValues) throws ParseException, IOException {
private void applyAnalyses(SolrQueryRequest req, Iterable<ChronixAnalysis> analyses, JoinFunction key, long queryStart, long queryEnd, Map.Entry<String, List<SolrDocument>> docs, MetricTimeSeries timeSeries, FunctionValueMap analysisAndValues) throws ParseException, IOException {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: More than 7 parameters (found 8).

} else {
LOGGER.info("{} is unknown. {} is ignored", type, type);
}
}

private static void addAggregation(QueryFunctions<MetricTimeSeries> result, FunctionType type, String[] arguments) {
private static void addStrace(QueryFunctions result, FunctionType type, String[] arguments) {
switch (type) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: switch without "default" clause.

}

private static void addLsof(QueryFunctions result, FunctionType type, String[] arguments) {
switch (type) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: switch without "default" clause.

@@ -203,7 +227,7 @@ private static void addAnalysis(QueryFunctions<MetricTimeSeries> result, Functio
}
}

private static void addTransformation(QueryFunctions<MetricTimeSeries> result, FunctionType type, String[] arguments) {
private static void addTransformation(QueryFunctions result, FunctionType type, String[] arguments) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: NCSS for this method is 51 (max allowed is 50).

//Performance optimization. Avoiding fine grained growing.
if (timestamps == null) {
int size = ts.size();
if (size < 1000) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: Nested if-else depth is 2 (max allowed is 1).

//Performance optimization. Avoiding fine grained growing.
if (timestamps == null) {
int size = ts.size();
if (size < 1000) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: Nested if-else depth is 2 (max allowed is 1).


static {
Collections.addAll(AGGREGATIONS, AVG, MIN, MAX, DEV, P, SUM, COUNT, FIRST, LAST, RANGE, DIFF, SDIFF);
Collections.addAll(AGGREGATIONS, AVG, MIN, MAX, DEV, P, SUM, COUNT, FIRST, LAST, RANGE, DIFF, SDIFF,INTEGRAL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: ',' is not followed by whitespace.


//If it is empty, we return NaN
if (timeSeries.size() <= 0) {
return Double.NaN;
functionValueMap.add(this,Double.NaN);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: ',' is not followed by whitespace.

//If it is empty, we return NaN
if (timeSeries.size() <= 0) {
return Double.NaN;
functionValueMap.add(this,Double.NaN);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: ',' is not followed by whitespace.

@@ -55,8 +49,8 @@ public double execute(MetricTimeSeries... args) {
double firstValue = timeSeries.getValue(0);
double lastValue = timeSeries.getValue(timeSeries.size() - 1);

//return the difference
return Math.abs(firstValue - lastValue);
functionValueMap.add(this,Math.abs(firstValue - lastValue));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Checkstyle] ERROR: ',' is not followed by whitespace.

@coveralls
Copy link

coveralls commented Oct 4, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling aeb5787 on FlorianLautenschlager:master into 9db9766 on ChronixDB:master.

@FlorianLautenschlager FlorianLautenschlager merged commit 2d8dbcb into ChronixDB:master Oct 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants