Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-2429

Swapped arguments to registerQueueGauge cause wrong tags on metrics

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.9.0
    • 2.10.0
    • Broker
    • None

    Description

      *** CID 1483198:  API usage errors  (SWAPPED_ARGUMENTS)
      /activemq-artemis/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java: 3872 in org.apache.activemq.artemis.core.server.impl.QueueImpl.registerMeters()()
      3866           String addressName = address.toString();
      3867           String queueName = name.toString();
      3868     
      3869           if (server != null && server.getMetricsManager() != null) {
      3870              MetricsManager metricsManager = server.getMetricsManager();
      3871     
      >>>     CID 1483198:  API usage errors  (SWAPPED_ARGUMENTS)
      >>>     The positions of arguments in the call to "registerQueueGauge" do not match the ordering of the parameters:
      * "queueName" is passed to "address"
      * "addressName" is passed to "queue"
      3872              metricsManager.registerQueueGauge(queueName, addressName, (builder) -> {
      3873                 builder.register(QueueMetricNames.MESSAGE_COUNT, pendingMetrics, metrics -> Double.valueOf(pendingMetrics.getMessageCount()), QueueControl.MESSAGE_COUNT_DESCRIPTION);
      3874                 builder.register(QueueMetricNames.DURABLE_MESSAGE_COUNT, pendingMetrics, metrics -> Double.valueOf(pendingMetrics.getDurableMessageCount()), QueueControl.DURABLE_MESSAGE_COUNT_DESCRIPTION);
      3875                 builder.register(QueueMetricNames.PERSISTENT_SIZE, pendingMetrics, metrics -> Double.valueOf(pendingMetrics.getPersistentSize()), QueueControl.PERSISTENT_SIZE_DESCRIPTION);
      3876                 builder.register(QueueMetricNames.DURABLE_PERSISTENT_SIZE, pendingMetrics, metrics -> Double.valueOf(pendingMetrics.getDurablePersistentSize()), QueueControl.DURABLE_PERSISTENT_SIZE_DESCRIPTION);
      3877     
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jdanek Jiri Daněk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m