class StreamsMetricsImpl implements StreamsMetrics {

    public final Sensor taskLevelSensor(final String threadId,
                                        final String taskId,
                                        final String sensorName,
                                        final RecordingLevel recordingLevel,
                                        final Sensor... parents) {
        final String key = taskSensorPrefix(threadId, taskId);
        synchronized (taskLevelSensors) {
            final String fullSensorName = key + SENSOR_NAME_DELIMITER + sensorName;
            return Optional.ofNullable(metrics.getSensor(fullSensorName))
                .orElseGet(() -> {
                    taskLevelSensors.computeIfAbsent(key, ignored -> new LinkedList<>()).push(fullSensorName);
                    return metrics.sensor(fullSensorName, recordingLevel, parents);
                });
        }
    }

    public  StreamsMetricsImpl(final Metrics metrics,
                              final String clientId,
                              final String builtInMetricsVersion,
                              final Time time);

}