All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opensearch.test.telemetry.MockTelemetryPlugin Maven / Gradle / Ivy

There is a newer version: 2.18.0
Show newest version
/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 */

package org.opensearch.test.telemetry;

import org.opensearch.plugins.Plugin;
import org.opensearch.plugins.TelemetryPlugin;
import org.opensearch.telemetry.Telemetry;
import org.opensearch.telemetry.TelemetrySettings;

import java.util.Optional;

/**
 * Mock {@link TelemetryPlugin} implementation for testing.
 */
public class MockTelemetryPlugin extends Plugin implements TelemetryPlugin {
    private static final String MOCK_TRACER_NAME = "mock";

    /**
     * Base constructor.
     */
    public MockTelemetryPlugin() {

    }

    @Override
    public Optional getTelemetry(TelemetrySettings settings) {
        return Optional.of(new MockTelemetry(settings));
    }

    @Override
    public String getName() {
        return MOCK_TRACER_NAME;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy