ObservableResult.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. import { MetricAttributes, Observable } from './Metric';
  2. /**
  3. * Interface that is being used in callback function for Observable Metric.
  4. */
  5. export interface ObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
  6. /**
  7. * Observe a measurement of the value associated with the given attributes.
  8. *
  9. * @param value The value to be observed.
  10. * @param attributes The attributes associated with the value. If more than
  11. * one values associated with the same attributes values, SDK may pick the
  12. * last one or simply drop the entire observable result.
  13. */
  14. observe(this: ObservableResult<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
  15. }
  16. /**
  17. * Interface that is being used in batch observable callback function.
  18. */
  19. export interface BatchObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
  20. /**
  21. * Observe a measurement of the value associated with the given attributes.
  22. *
  23. * @param metric The observable metric to be observed.
  24. * @param value The value to be observed.
  25. * @param attributes The attributes associated with the value. If more than
  26. * one values associated with the same attributes values, SDK may pick the
  27. * last one or simply drop the entire observable result.
  28. */
  29. observe(this: BatchObservableResult<AttributesTypes>, metric: Observable<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
  30. }
  31. //# sourceMappingURL=ObservableResult.d.ts.map