Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-9440

Wrong paging in api/measures/search_history WS

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.5-M2, 6.5
    • Component/s: Measures, Web API
    • Labels:

      Description

      Use case

      The paging in api/measures/search_history can be wrong.
      For instance https://next.sonarqube.com/sonarqube/api/measures/search_history?component=com.sonarsource.burgr%3Aburgr&metrics=bugs&ps=1000 is returning :

      {
          "paging": {
              "pageIndex": 1,
              "pageSize": 1000,
              "total": 156
          },
          "measures": [
              {
                  "metric": "bugs",
                  "history": [
                      {
                          "date": "2016-03-04T09:46:29+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-03-04T15:39:28+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-03-06T05:09:27+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-03-07T16:32:56+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-03-14T04:08:52+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-03-14T15:45:04+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-03-15T04:08:51+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-03-25T04:10:37+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-03-31T09:27:27+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-04-01T05:15:22+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-04-06T05:10:11+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-04-08T09:26:40+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-04-08T14:36:14+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-04-08T15:20:20+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-04-12T06:29:21+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-04-13T05:15:07+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-04-18T09:39:16+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-04-22T17:37:36+0200",
                          "value": "1"
                      },
                      {
                          "date": "2016-04-22T17:55:10+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-04-25T14:44:25+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-05-04T15:32:17+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-05-04T16:39:33+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-05-04T17:25:33+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-05-21T05:31:52+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-05-27T13:36:28+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-05-27T13:41:33+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-05-27T14:21:08+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-05-27T14:27:40+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-05-30T10:16:33+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-06-01T05:30:47+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-06-10T11:58:01+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-06-10T15:36:36+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-06-13T14:16:28+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-06-17T09:51:43+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-06-18T05:19:41+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-06-22T16:03:19+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-06-22T18:00:44+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-06-24T10:57:15+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-06-24T14:43:33+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-07-01T15:51:16+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-07-01T16:17:34+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-07-09T05:32:46+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-07-12T05:34:49+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-07-15T05:37:50+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-07-21T05:37:39+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-07-23T05:37:17+0200",
                          "value": "1"
                      },
                      {
                          "date": "2016-07-29T05:28:30+0200",
                          "value": "1"
                      },
                      {
                          "date": "2016-08-06T05:18:04+0200",
                          "value": "1"
                      },
                      {
                          "date": "2016-08-11T05:18:20+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-08-16T11:28:18+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-08-16T11:43:30+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-08-16T12:04:33+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-08-17T05:08:25+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-08-18T05:08:29+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-08-19T05:16:02+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-08-24T05:15:08+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-01T09:59:14+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-01T14:12:11+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-06T11:27:53+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-07T14:01:16+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-07T14:24:52+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-07T14:47:54+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-14T15:08:17+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-16T17:42:16+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-23T16:23:35+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-23T16:36:35+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-23T17:56:15+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-09-27T05:10:41+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-10-03T16:17:28+0200",
                          "value": "6"
                      },
                      {
                          "date": "2016-10-03T16:59:19+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-10-04T05:09:06+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-10-06T11:26:45+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-10-13T16:28:24+0200",
                          "value": "1"
                      },
                      {
                          "date": "2016-10-14T18:40:55+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-10-17T12:03:53+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-10-17T12:09:55+0200",
                          "value": "0"
                      },
                      {
                          "date": "2016-10-31T15:22:33+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-03T18:05:21+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-04T17:43:21+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-04T17:43:30+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-04T18:28:21+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-04T18:29:05+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-07T17:18:24+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-09T09:48:54+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-10T18:56:33+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-11T09:25:52+0100",
                          "value": "1"
                      },
                      {
                          "date": "2016-11-11T09:26:13+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-14T14:03:32+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-14T16:09:13+0100",
                          "value": "2"
                      },
                      {
                          "date": "2016-11-14T16:58:22+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-21T19:58:27+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-11-30T17:20:48+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-12-01T10:00:49+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-12-01T16:58:41+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-12-02T16:44:28+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-12-19T15:09:43+0100",
                          "value": "6"
                      },
                      {
                          "date": "2016-12-19T16:53:39+0100",
                          "value": "6"
                      },
                      {
                          "date": "2016-12-23T10:11:49+0100",
                          "value": "2"
                      },
                      {
                          "date": "2016-12-23T10:48:42+0100",
                          "value": "0"
                      },
                      {
                          "date": "2016-12-29T17:07:52+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-01-06T11:12:30+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-01-09T09:19:43+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-01-13T18:04:56+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-01-16T16:47:13+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-01-26T15:40:21+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-01-30T08:41:10+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-01-30T10:12:23+0100",
                          "value": "1"
                      },
                      {
                          "date": "2017-01-31T14:56:35+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-01-31T16:43:44+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-01-31T17:33:04+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-02-02T16:12:25+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-02-02T18:04:33+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-02-10T09:58:02+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-02-16T08:51:09+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-02-16T18:04:57+0100",
                          "value": "1"
                      },
                      {
                          "date": "2017-02-16T18:12:24+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-02-17T16:19:39+0100",
                          "value": "2"
                      },
                      {
                          "date": "2017-02-20T09:06:37+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-02-20T09:17:35+0100",
                          "value": "0"
                      },
                      {
                          "date": "2017-03-30T11:15:56+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-04-06T15:32:44+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-04-06T16:00:36+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-04-07T14:43:52+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-04-11T11:23:39+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-04-12T10:58:12+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-04-12T11:21:36+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-04-12T11:52:42+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-04-18T15:29:09+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-04-24T10:54:48+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-05-09T14:19:01+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-05-11T17:50:35+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-05-17T10:50:27+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-05-19T16:19:44+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-05-19T16:47:56+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-05-24T09:03:25+0200",
                          "value": "0"
                      },
                      {
                          "date": "2017-05-24T09:12:00+0200",
                          "value": "0"
                      }
                  ]
              }
          ]
      }
      

      Where 'total' is 156 but number of elements in history is 136

      Explanation

      Number of analysis is 156, but only the last 136 analysis have the measures 'bugs'.

      The problem is coming from the fact that the total number of elements is computed from the number of analysis, but not every analysis have the requested measure.
      In this case the 'bugs' measure have been introduced recently, so a lot of analysis in the past do not have this measure.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                teryk.bellahsene Teryk Bellahsene (Inactive)
                Reporter:
                julien.lancelot Julien Lancelot
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: