public static Sensor activeProcessRatioSensor(final String threadId,
                                                  final String taskId,
                                                  final StreamsMetricsImpl streamsMetrics) {
        final String name = ACTIVE_TASK_PREFIX + PROCESS + RATIO_SUFFIX;
        final Sensor sensor = streamsMetrics.taskLevelSensor(threadId, taskId, name, Sensor.RecordingLevel.INFO);
        addValueMetricToSensor(
            sensor,
            TASK_LEVEL_GROUP,
            streamsMetrics.taskLevelTagMap(threadId, taskId),
            name,
            PROCESS_RATIO_DESCRIPTION
        );
        return sensor;
    }
@Test
    public void shouldGetActiveProcessRatioSensor() {
        final String operation = "active-process-ratio";
        when(streamsMetrics.taskLevelSensor(THREAD_ID, TASK_ID, operation, RecordingLevel.INFO))
                .thenReturn(expectedSensor);

        final String ratioDescription = "The fraction of time the thread spent " +
            "on processing this task among all assigned active tasks";
        when(streamsMetrics.taskLevelTagMap(THREAD_ID, TASK_ID)).thenReturn(tagMap);

        try (final MockedStatic<StreamsMetricsImpl> streamsMetricsStaticMock = mockStatic(StreamsMetricsImpl.class)) {
            final Sensor sensor = TaskMetrics.activeProcessRatioSensor(THREAD_ID, TASK_ID, streamsMetrics);
            streamsMetricsStaticMock.verify(
                () -> StreamsMetricsImpl.addValueMetricToSensor(
                    expectedSensor,
                    TASK_LEVEL_GROUP,
                    tagMap,
                    operation,
                    ratioDescription
                )
            );
            assertThat(sensor, is(expectedSensor));
        }
    }