use of org.apache.flink.runtime.rest.messages.MessagePathParameter in project flink by apache.
the class MetricQuerier method getMetricList.
public AggregatedMetricsResponseBody getMetricList(TestEnvironment.Endpoint endpoint, JobID jobId, JobVertexID vertexId) throws Exception {
AggregatedSubtaskMetricsParameters subtaskMetricsParameters = new AggregatedSubtaskMetricsParameters();
Iterator<MessagePathParameter<?>> pathParams = subtaskMetricsParameters.getPathParameters().iterator();
((JobIDPathParameter) pathParams.next()).resolve(jobId);
((JobVertexIdPathParameter) pathParams.next()).resolve(vertexId);
return restClient.sendRequest(endpoint.getAddress(), endpoint.getPort(), AggregatedSubtaskMetricsHeaders.getInstance(), subtaskMetricsParameters, EmptyRequestBody.getInstance()).get(30, TimeUnit.SECONDS);
}
use of org.apache.flink.runtime.rest.messages.MessagePathParameter in project flink by apache.
the class MetricQuerier method getMetrics.
public AggregatedMetricsResponseBody getMetrics(TestEnvironment.Endpoint endpoint, JobID jobId, JobVertexID vertexId, String filters) throws Exception {
AggregatedSubtaskMetricsParameters subtaskMetricsParameters = new AggregatedSubtaskMetricsParameters();
Iterator<MessagePathParameter<?>> pathParams = subtaskMetricsParameters.getPathParameters().iterator();
((JobIDPathParameter) pathParams.next()).resolve(jobId);
((JobVertexIdPathParameter) pathParams.next()).resolve(vertexId);
MetricsFilterParameter metricFilter = (MetricsFilterParameter) subtaskMetricsParameters.getQueryParameters().iterator().next();
metricFilter.resolveFromString(filters);
return restClient.sendRequest(endpoint.getAddress(), endpoint.getPort(), AggregatedSubtaskMetricsHeaders.getInstance(), subtaskMetricsParameters, EmptyRequestBody.getInstance()).get(30, TimeUnit.SECONDS);
}
Aggregations