class Metrics {

    private static final Logger LOGGER = LoggerFactory.getLogger(Metrics.class);

    private static final StatsdConfig statsdConfig = new StatsdConfig() {
        @Override
        public String get(String k) {
            return null;
        }

        @Override
        public StatsdFlavor flavor() {
            return RuntimeEnvironment.getInstance().getStatsdConfig().getFlavor();
        }

        @Override
        public int port() {
            return RuntimeEnvironment.getInstance().getStatsdConfig().getPort();
        }

        @Override
        public String host() {
            return RuntimeEnvironment.getInstance().getStatsdConfig().getHost();
        }

        @Override
        public boolean buffered() {
            return true;
        }
    };

    private static PrometheusMeterRegistry prometheusRegistry;
    private static StatsdMeterRegistry statsdRegistry;

    static {
        MeterRegistry registry = null;

        if (RuntimeEnvironment.getInstance().getStatsdConfig().isEnabled()) {
            LOGGER.log(Level.INFO, "configuring StatsdRegistry");
            statsdRegistry = new StatsdMeterRegistry(statsdConfig, Clock.SYSTEM);
            registry = statsdRegistry;
        } else if (!RuntimeEnvironment.getInstance().isIndexer()) {
            LOGGER.log(Level.INFO, "configuring PrometheusRegistry");
            prometheusRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
            registry = prometheusRegistry;
        }

        if (registry != null) {
            new ClassLoaderMetrics().bindTo(registry);
            new JvmMemoryMetrics().bindTo(registry);
            new JvmGcMetrics().bindTo(registry);
            new ProcessorMetrics().bindTo(registry);
            new JvmThreadMetrics().bindTo(registry);
        }
    }

    private Metrics() {
    }

    public static void updateSubFiles(List<String> subFiles) {<FILL_FUNCTION_BODY>}

    public static PrometheusMeterRegistry getPrometheusRegistry() {
        return prometheusRegistry;
    }

    private static StatsdMeterRegistry getStatsdRegistry() {
        return statsdRegistry;
    }

    /**
     * Get registry based on running context.
     * @return MeterRegistry instance
     */
    public static MeterRegistry getRegistry() {
        if (RuntimeEnvironment.getInstance().isIndexer()) {
            return getStatsdRegistry();
        } else {
            return getPrometheusRegistry();
        }
    }
}

        // Add tag for per-project reindex.
        if (statsdRegistry != null && !subFiles.isEmpty()) {
            String projects = subFiles.stream().
                    map(s -> s.startsWith(Indexer.PATH_SEPARATOR_STRING) ? s.substring(1) : s).
                    collect(Collectors.joining(","));
            Tag commonTag = Tag.of("projects", projects);
            LOGGER.log(Level.FINE, "updating statsdRegistry with common tag: {}", commonTag);
            statsdRegistry.config().commonTags(Collections.singleton(commonTag));
        }
    
<no_super_class>