Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-16185

Add tests to cover CommitLog metrics

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Patch Available
    • Priority: Normal
    • Resolution: Unresolved
    • Fix Version/s: 4.0.x
    • Component/s: Test/unit
    • Labels:
      None
    • Change Category:
      Quality Assurance
    • Complexity:
      Normal
    • Test and Documentation Plan:
      Hide

      CommitLogMetrics Test-CasesCommitLogMetrics Test-Cases

       

      1.  For below metrics, test-case are added in CommitLogTest.java . In test-cases, mutations are added, which internally update metrics. 

      • completedTasks
      • totalCommitLogSize
      • waitingOnCommit

       

      2. pendingTasks - In AbstractCommitLogService.java , added testPendingTasks test-case,  since pendingTasks metric are incremented and decremented in single method of  AbstractCommitLogService::maybeWaitForSync .

      So introduced a dummy method incrementPendingTaks in  FakeCommitLogService-class, to manually update pendingTasks metric.

       

      3. waitingOnSegmentAllocation - In CommitLogMetricsTest.java test-case is added. In test commitlog_segment_size_in_mb is changed to 1mb, and adding multiple  mutations so that waitingOnSegmentAllocation metric updated while creating new segments.

      In normal case , waitingOnSegmentAllocation it will be zero, if during test-execution, waitingOnSegmentAllocation was not updated, then manually updating it.

      Show
      CommitLogMetrics Test-CasesCommitLogMetrics Test-Cases   1.  For below metrics, test-case are added in CommitLogTest.java . In test-cases, mutations are added, which internally update metrics.  completedTasks totalCommitLogSize waitingOnCommit   2. pendingTasks - In AbstractCommitLogService.java , added testPendingTasks test-case,  since pendingTasks metric are incremented and decremented in single method of  AbstractCommitLogService::maybeWaitForSync . So introduced a dummy method incrementPendingTaks in  FakeCommitLogService-class, to manually update pendingTasks metric.   3. waitingOnSegmentAllocation - In CommitLogMetricsTest.java test-case is added. In test commitlog_segment_size_in_mb is changed to 1mb , and adding multiple  mutations so that waitingOnSegmentAllocation metric updated while creating new segments. In normal case , waitingOnSegmentAllocation it will be zero, if during test-execution, waitingOnSegmentAllocation was not updated, then manually updating it.

      Description

      The only metrics that seems to be covered by unit test for the CommitLog metrics is oversizedMutations. We should add testing the other ones.

        Attachments

          Activity

            People

            • Assignee:
              yasar_baigh Yasar Arafath Baigh Assign to me
              Reporter:
              blerer Benjamin Lerer
              Authors:
              Berenguer Blasi, Yasar Arafath Baigh
              Reviewers:
              Adam Holmberg, Berenguer Blasi

              Dates

              • Created:
                Updated:

                Time Tracking

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

                  Issue deployment