Search in sources :

Example 1 with MetricsFilterParameter

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);
}
Also used : AggregatedSubtaskMetricsParameters(org.apache.flink.runtime.rest.messages.job.metrics.AggregatedSubtaskMetricsParameters) JobIDPathParameter(org.apache.flink.runtime.rest.messages.JobIDPathParameter) JobVertexIdPathParameter(org.apache.flink.runtime.rest.messages.JobVertexIdPathParameter) MessagePathParameter(org.apache.flink.runtime.rest.messages.MessagePathParameter) MetricsFilterParameter(org.apache.flink.runtime.rest.messages.job.metrics.MetricsFilterParameter)

Aggregations

JobIDPathParameter (org.apache.flink.runtime.rest.messages.JobIDPathParameter)1 JobVertexIdPathParameter (org.apache.flink.runtime.rest.messages.JobVertexIdPathParameter)1 MessagePathParameter (org.apache.flink.runtime.rest.messages.MessagePathParameter)1 AggregatedSubtaskMetricsParameters (org.apache.flink.runtime.rest.messages.job.metrics.AggregatedSubtaskMetricsParameters)1 MetricsFilterParameter (org.apache.flink.runtime.rest.messages.job.metrics.MetricsFilterParameter)1