Interface MetricDescriptorStrategy


  • public interface MetricDescriptorStrategy
    The strategy for how to handle metric descriptors.
    • Field Detail

      • ALWAYS_SEND

        static final MetricDescriptorStrategy ALWAYS_SEND
        A strategy that always sends metric descriptors.

        This means EVERY create timeseries call will include several metric descriptor calls. This is not recommended.

      • NEVER_SEND

        static final MetricDescriptorStrategy NEVER_SEND
        A strategy that never sends metric descriptors and relies on auto-creation.
      • SEND_ONCE

        static final MetricDescriptorStrategy SEND_ONCE
        A strategy that sends descriptors once per classloader instance.
    • Method Detail

      • exportDescriptors

        void exportDescriptors​(java.lang.Iterable<com.google.api.MetricDescriptor> batchDescriptors,
                               java.util.function.Consumer<com.google.api.MetricDescriptor> export)
        Determines what to do with metric descriptors.
        Parameters:
        batchDescriptors - The set of metrics being exported in a batch.
        export - A consumer that will ensure metric descriptors are registered to cloud monitoring.