Class QueuedAgentService

  • All Implemented Interfaces:
    ForceQueueEnabledProxyAPI, WavefrontV2API, com.wavefront.api.ProxyV2API, com.wavefront.api.SourceTagAPI

    public class QueuedAgentService
    extends Object
    implements ForceQueueEnabledProxyAPI
    A wrapper for any WavefrontAPI that queues up any result posting if the backend is not available. Current data will always be submitted right away (thus prioritizing live data) while background threads will submit backlogged data.
    Author:
    Clement Pang ([email protected])
    • Method Detail

      • getBytesPerMinute

        @Nullable
        public Long getBytesPerMinute()
        Returns:
        bytes per minute for requests submissions. Null if no data is available yet.
      • start

        public void start()
      • isRunning

        public boolean isRunning()
      • shutdown

        public void shutdown()
      • setRetryBackoffBaseSeconds

        public static void setRetryBackoffBaseSeconds​(com.google.common.util.concurrent.AtomicDouble newSecs)
      • getQueuedTasksCount

        public long getQueuedTasksCount()
      • getQueuedSourceTagTasksCount

        public long getQueuedSourceTagTasksCount()
      • proxyCheckin

        public com.wavefront.api.agent.AgentConfiguration proxyCheckin​(UUID agentId,
                                                                       String token,
                                                                       String hostname,
                                                                       String version,
                                                                       Long currentMillis,
                                                                       com.fasterxml.jackson.databind.JsonNode agentMetrics,
                                                                       Boolean ephemeral)
        Specified by:
        proxyCheckin in interface com.wavefront.api.ProxyV2API
      • proxyReport

        public javax.ws.rs.core.Response proxyReport​(UUID agentId,
                                                     String format,
                                                     String pushData)
        Specified by:
        proxyReport in interface com.wavefront.api.ProxyV2API
      • proxyReport

        public javax.ws.rs.core.Response proxyReport​(UUID agentId,
                                                     String format,
                                                     String pushData,
                                                     boolean forceToQueue)
        Description copied from interface: ForceQueueEnabledProxyAPI
        Report batched data (metrics, histograms, spans, etc) to Wavefront servers.
        Specified by:
        proxyReport in interface ForceQueueEnabledProxyAPI
        Parameters:
        agentId - Proxy Id reporting the result.
        format - The format of the data (wavefront, histogram, trace, spanLogs)
        pushData - Push data batch (newline-delimited)
        forceToQueue - Whether to bypass posting data to the API and write to queue instead.
      • proxyConfigProcessed

        public void proxyConfigProcessed​(UUID proxyId)
        Specified by:
        proxyConfigProcessed in interface com.wavefront.api.ProxyV2API
      • proxyError

        public void proxyError​(UUID proxyId,
                               String details)
        Specified by:
        proxyError in interface com.wavefront.api.ProxyV2API
      • appendTag

        public javax.ws.rs.core.Response appendTag​(String id,
                                                   String token,
                                                   String tagValue)
        Specified by:
        appendTag in interface com.wavefront.api.SourceTagAPI
      • removeTag

        public javax.ws.rs.core.Response removeTag​(String id,
                                                   String token,
                                                   String tagValue)
        Specified by:
        removeTag in interface com.wavefront.api.SourceTagAPI
      • removeDescription

        public javax.ws.rs.core.Response removeDescription​(String id,
                                                           String token)
        Specified by:
        removeDescription in interface com.wavefront.api.SourceTagAPI
      • setTags

        public javax.ws.rs.core.Response setTags​(String id,
                                                 String token,
                                                 List<String> tagValuesToSet)
        Specified by:
        setTags in interface com.wavefront.api.SourceTagAPI
      • setDescription

        public javax.ws.rs.core.Response setDescription​(String id,
                                                        String token,
                                                        String description)
        Specified by:
        setDescription in interface com.wavefront.api.SourceTagAPI
      • setTags

        public javax.ws.rs.core.Response setTags​(String id,
                                                 List<String> tagValuesToSet,
                                                 boolean forceToQueue)
        Description copied from interface: ForceQueueEnabledProxyAPI
        Sets tags for a host, overriding existing tags.
        Specified by:
        setTags in interface ForceQueueEnabledProxyAPI
        Parameters:
        id - source ID.
        tagValuesToSet - tags to set.
        forceToQueue - Whether to bypass posting data to the API and write to queue instead.
      • removeDescription

        public javax.ws.rs.core.Response removeDescription​(String id,
                                                           boolean forceToQueue)
        Description copied from interface: ForceQueueEnabledProxyAPI
        Remove description from a source.
        Specified by:
        removeDescription in interface ForceQueueEnabledProxyAPI
        Parameters:
        id - source ID.
        forceToQueue - Whether to bypass posting data to the API and write to queue instead.
      • setDescription

        public javax.ws.rs.core.Response setDescription​(String id,
                                                        String desc,
                                                        boolean forceToQueue)
        Description copied from interface: ForceQueueEnabledProxyAPI
        Set description for a source.
        Specified by:
        setDescription in interface ForceQueueEnabledProxyAPI
        Parameters:
        id - source ID.
        desc - description.
        forceToQueue - Whether to bypass posting data to the API and write to queue instead.
      • appendTag

        public javax.ws.rs.core.Response appendTag​(String id,
                                                   String tagValue,
                                                   boolean forceToQueue)
        Description copied from interface: ForceQueueEnabledProxyAPI
        Add a single tag to a source.
        Specified by:
        appendTag in interface ForceQueueEnabledProxyAPI
        Parameters:
        id - source ID.
        tagValue - tag value to add.
        forceToQueue - Whether to bypass posting data to the API and write to queue instead.
      • removeTag

        public javax.ws.rs.core.Response removeTag​(String id,
                                                   String tagValue,
                                                   boolean forceToQueue)
        Description copied from interface: ForceQueueEnabledProxyAPI
        Remove a single tag from a source.
        Specified by:
        removeTag in interface ForceQueueEnabledProxyAPI
        Parameters:
        id - source ID.
        tagValue - tag to remove.
        forceToQueue - Whether to bypass posting data to the API and write to queue instead.