class TrackingProcessor extends GenericProcessor implements EventProcessor {

    @Override
    public void printOn(Media media) {
        super.printOn(media);
        media.with("tokenStoreIdentifier", tokenStoreIdentifier);

        Set<String> freeThreadInstances =
                processors().stream()
                            .filter(processor -> processor.eventProcessorInfo().getAvailableThreads() > ZERO_THREADS)
                            .map(ClientProcessor::clientId)
                            .collect(Collectors.toSet());

        Integer activeThreads = processorInstances().stream()
                                                    .map(EventProcessorInfo::getActiveThreads)
                                                    .reduce(Integer::sum)
                                                    .orElse(0);

        boolean isRunning = processors().stream().anyMatch(ClientProcessor::running);

        int largestSegmentFactor = processorInstances().stream()
                                                       .map(EventProcessorInfo::getSegmentStatusList)
                                                       .flatMap(List::stream)
                                                       .mapToInt(EventProcessorInfo.SegmentStatus::getOnePartOf)
                                                       .min()
                                                       .orElse(1);
        boolean canMerge = isRunning && largestSegmentFactor != 1;

        media.withStrings(FREE_THREAD_INSTANCES_COUNT, freeThreadInstances)
             .with(ACTIVE_THREADS_COUNT, activeThreads)
             .with(CAN_PAUSE_KEY, isRunning)
             .with(CAN_PLAY_KEY, processors().stream().anyMatch(p -> !p.running()))
             .with(CAN_SPLIT_KEY, isRunning)
             .with(CAN_MERGE_KEY, canMerge)
             .with(TRACKERS_LIST_KEY, trackers());
    }

      TrackingProcessor(String name, String mode, Collection<ClientProcessor> processors);

}