This repository has been archived by the owner on Jul 29, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added a chart to display global Health Check average\nThis closes
- Loading branch information
Showing
7 changed files
with
173 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/io/gravitee/repository/healthcheck/query/DateHistogramQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Copyright (C) 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.healthcheck.query; | ||
|
||
import io.gravitee.repository.analytics.query.Aggregation; | ||
import io.gravitee.repository.healthcheck.query.response.histogram.DateHistogramResponse; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Azize ELAMRANI (azize.elamrani at graviteesource.com) | ||
* @author GraviteeSource Team | ||
*/ | ||
public class DateHistogramQuery extends AbstractQuery<DateHistogramResponse> { | ||
|
||
private List<Aggregation> aggregations = new ArrayList<>(); | ||
|
||
@Override | ||
public Class<DateHistogramResponse> responseType() { | ||
return DateHistogramResponse.class; | ||
} | ||
|
||
public List<Aggregation> aggregations() { | ||
return aggregations; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/main/java/io/gravitee/repository/healthcheck/query/DateHistogramQueryBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright (C) 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.healthcheck.query; | ||
|
||
import io.gravitee.repository.analytics.query.Aggregation; | ||
import io.gravitee.repository.analytics.query.AggregationType; | ||
|
||
/** | ||
* @author Azize ELAMRANI (azize.elamrani at graviteesource.com) | ||
* @author GraviteeSource Team | ||
*/ | ||
public class DateHistogramQueryBuilder extends AbstractQueryBuilder<DateHistogramQueryBuilder, DateHistogramQuery> { | ||
|
||
protected DateHistogramQueryBuilder(DateHistogramQuery query) { | ||
super(query); | ||
} | ||
|
||
static DateHistogramQueryBuilder query() { | ||
return new DateHistogramQueryBuilder(new DateHistogramQuery()); | ||
} | ||
|
||
public DateHistogramQueryBuilder aggregation(Aggregation aggregation) { | ||
query.aggregations().add(aggregation); | ||
return this; | ||
} | ||
|
||
public DateHistogramQueryBuilder aggregation(AggregationType type, String field) { | ||
query.aggregations().add(new Aggregation() { | ||
@Override | ||
public AggregationType type() { | ||
return type; | ||
} | ||
|
||
@Override | ||
public String field() { | ||
return field; | ||
} | ||
}); | ||
|
||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...va/io/gravitee/repository/healthcheck/query/response/histogram/DateHistogramResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Copyright (C) 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.repository.healthcheck.query.response.histogram; | ||
|
||
import io.gravitee.repository.healthcheck.query.Response; | ||
import io.gravitee.repository.analytics.query.response.histogram.Bucket; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Azize ELAMRANI (azize.elamrani at graviteesource.com) | ||
* @author GraviteeSource Team | ||
*/ | ||
public class DateHistogramResponse implements Response { | ||
|
||
private final List<Long> timestamps = new ArrayList<>(); | ||
private final List<Bucket> values = new ArrayList<>(); | ||
|
||
public List<Bucket> values() { | ||
return values; | ||
} | ||
|
||
public List<Long> timestamps() { | ||
return timestamps; | ||
} | ||
} |