Search in sources :

Example 1 with AggregatedSubtaskMetricsParameters

use of org.apache.flink.runtime.rest.messages.job.metrics.AggregatedSubtaskMetricsParameters 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);
}
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)

Example 2 with AggregatedSubtaskMetricsParameters

use of org.apache.flink.runtime.rest.messages.job.metrics.AggregatedSubtaskMetricsParameters 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)2 JobVertexIdPathParameter (org.apache.flink.runtime.rest.messages.JobVertexIdPathParameter)2 MessagePathParameter (org.apache.flink.runtime.rest.messages.MessagePathParameter)2 AggregatedSubtaskMetricsParameters (org.apache.flink.runtime.rest.messages.job.metrics.AggregatedSubtaskMetricsParameters)2 MetricsFilterParameter (org.apache.flink.runtime.rest.messages.job.metrics.MetricsFilterParameter)1