Interface MicrometerMetricsExporter.MeterRegistry

Enclosing class:
MicrometerMetricsExporter

public static interface MicrometerMetricsExporter.MeterRegistry
Meter registry abstraction to avoid compile-time Micrometer dependency 指标注册表抽象,避免编译时 Micrometer 依赖
Since:
JDK 25, opencode-base-cache V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • gauge

      <T> void gauge(String name, String[] tags, T obj, ToDoubleFunction<T> function)
      Register a gauge 注册仪表
      Type Parameters:
      T - object type | 对象类型
      Parameters:
      name - metric name | 指标名称
      tags - tags | 标签
      obj - target object | 目标对象
      function - value function | 值函数
    • counter

      <T> void counter(String name, String[] tags, T obj, ToLongFunction<T> function)
      Register a function counter 注册函数计数器
      Type Parameters:
      T - object type | 对象类型
      Parameters:
      name - metric name | 指标名称
      tags - tags | 标签
      obj - target object | 目标对象
      function - value function | 值函数
    • timer

      <T> void timer(String name, String[] tags, T obj, ToLongFunction<T> countFunction, ToDoubleFunction<T> totalFunction)
      Register a function timer 注册函数定时器
      Type Parameters:
      T - object type | 对象类型
      Parameters:
      name - metric name | 指标名称
      tags - tags | 标签
      obj - target object | 目标对象
      countFunction - count function | 计数函数
      totalFunction - total time function (nanos) | 总时间函数(纳秒)
    • remove

      void remove(String namePrefix)
      Remove meters by name prefix 按名称前缀移除指标
      Parameters:
      namePrefix - name prefix | 名称前缀
    • wrap

      static MicrometerMetricsExporter.MeterRegistry wrap(Object meterRegistry)
      Wrap actual Micrometer MeterRegistry using reflection 使用反射包装实际的 Micrometer MeterRegistry
      Parameters:
      meterRegistry - actual Micrometer registry | 实际的 Micrometer 注册表
      Returns:
      wrapped registry | 包装的注册表