import { ComposedMetricMapping, ComposedMetricMappingSpec, SloTarget } from '../../../../model'; import { ObjectKindWatcherError, WatchEventsHandler } from '../../../../orchestrator'; import { ComposedMetricComputationConfig, ComposedMetricsManager } from '../composed-metrics-manager'; /** * Concrete `WatchEventsHandler` subinterface for `ComposedMetricMappings`. */ export interface ComposedMetricMappingWatchEventsHandler extends WatchEventsHandler { } /** * {@link ComposedMetricsManager} extension that allows adding and removing composed metric mappings. */ export interface ModifiableComposedMetricsManager extends ComposedMetricsManager { /** * Adds the specified {@link ComposedMetricMapping} to this manager to periodically compute the metric. * * @param mapping The {@link ComposedMetricMapping} to be added. * @param computationConfig The {@link ComposedMetricComputationConfig} for the mapping's composed metric type. */ addComposedMetricMapping(mapping: ComposedMetricMapping, computationConfig: ComposedMetricComputationConfig): void; /** * Removes the {@link ComposedMetricMapping} with the specified `key`. * * @param key The {@link ComposedMetricMapping} to be deleted (identified through its metadata). */ removeComposedMetricMapping(mapping: ComposedMetricMapping): void; } /** * Receives watch events for a {@link ComposedMetricMapping} and communicates them to the `ComposedMetricsManager`. * * If `supportedSloTargetKinds` is configured on the {@link ComposedMetricComputationConfig}, only mappings * with matching `SloTarget` types will be passed to the `ComposedMetricsManager`. */ export declare class DefaultComposedMetricMappingWatchEventsHandler implements ComposedMetricMappingWatchEventsHandler { private manager; private computationConfig; /** * If set, only ComposedMetricMappings that have one of these object kinds will be passed on, * the others will be ignored. */ private supportedSloTargetKinds?; /** * Creates a new `DefaultComposedMetricMappingWatchEventsHandler`. * * @param manager The {@link ModifiableComposedMetricsManager} that should be triggered by this watch events handler. * @param computationConfig The {@link ComposedMetricComputationConfig} that should be supplied with every mapping. */ constructor(manager: ModifiableComposedMetricsManager, computationConfig: ComposedMetricComputationConfig); onObjectAdded(obj: ComposedMetricMapping>): void; onObjectModified(obj: ComposedMetricMapping>): void; onObjectDeleted(obj: ComposedMetricMapping>): void; onError(error: ObjectKindWatcherError): void; private isSloTargetSupported; }