use of org.apache.flink.runtime.rest.messages.job.metrics.MetricsFilterParameter 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