Skip to content

Commit

Permalink
feat(health): Add Health API
Browse files Browse the repository at this point in the history
  • Loading branch information
brasseld committed Nov 30, 2015
1 parent 67972d0 commit 182cb56
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import io.gravitee.repository.analytics.AnalyticsException;
import io.gravitee.repository.analytics.query.Query;
import io.gravitee.repository.analytics.query.response.HealthResponse;
import io.gravitee.repository.analytics.query.response.Response;

/**
Expand All @@ -25,4 +26,6 @@
public interface AnalyticsRepository {

<T extends Response> T query(Query<T> query) throws AnalyticsException;

HealthResponse query(String api, long interval, long from, long to) throws AnalyticsException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* 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.analytics.query.response;

import java.util.Map;

/**
* @author David BRASSELY (brasseld at gmail.com)
*/
public class HealthResponse implements Response {

private long [] timestamps;

private Map<Integer, long[]> buckets;

public long [] timestamps() {
return timestamps;
}

public void timestamps(long[] timestamps) {
this.timestamps = timestamps;
}

public Map<Integer, long[]> buckets() {
return buckets;
}

public void buckets(Map<Integer, long[]> buckets) {
this.buckets = buckets;
}
}

0 comments on commit 182cb56

Please sign in to comment.