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

Add tests to cover CommitLog metrics

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Normal
    • Resolution: Unresolved
    • 4.0.x
    • Test/unit
    • None
    • Quality Assurance
    • Normal
    • 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

        Issue Links

          Activity

            People

              bereng Berenguer Blasi
              blerer Benjamin Lerer
              Berenguer Blasi, Yasar Arafath Baigh
              Adam Holmberg, Berenguer Blasi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

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