An alert diagnostic report can subtract duplicate alerts and label whether the remaining signal is focused, noisy, or needs review.

Program

Play the program to choose alert count and inspect the noise label.

alert_count
alert_noise_report.f90
Replay: real traced execution (multi-file project)
program alert_noise_report_demo
    implicit none
    integer :: alert_count
    integer :: duplicate_count
    integer :: useful_count
    character(len=8) :: label

    alert_count = 6
    duplicate_count = 2
    useful_count = alert_count - duplicate_count
    if (useful_count >= 7) then
        label = 'noisy'
    else if (duplicate_count >= useful_count) then
        label = 'review'
    else
        label = 'focused'
    end if
    print '(A, I0, 1X, A, I0, 1X, A)', 'alerts=', alert_count, 'useful=', useful_count, trim(label)
end program alert_noise_report_demo
program alert_noise_report_demo
    implicit none
    integer :: alert_count
    integer :: duplicate_count
    integer :: useful_count
    character(len=8) :: label

    alert_count = 3
    duplicate_count = 2
    useful_count = alert_count - duplicate_count
    if (useful_count >= 7) then
        label = 'noisy'
    else if (duplicate_count >= useful_count) then
        label = 'review'
    else
        label = 'focused'
    end if
    print '(A, I0, 1X, A, I0, 1X, A)', 'alerts=', alert_count, 'useful=', useful_count, trim(label)
end program alert_noise_report_demo
program alert_noise_report_demo
    implicit none
    integer :: alert_count
    integer :: duplicate_count
    integer :: useful_count
    character(len=8) :: label

    alert_count = 9
    duplicate_count = 2
    useful_count = alert_count - duplicate_count
    if (useful_count >= 7) then
        label = 'noisy'
    else if (duplicate_count >= useful_count) then
        label = 'review'
    else
        label = 'focused'
    end if
    print '(A, I0, 1X, A, I0, 1X, A)', 'alerts=', alert_count, 'useful=', useful_count, trim(label)
end program alert_noise_report_demo
  1. alert_count ← 6

    8alert_count = 69duplicate_count = 2
    values this step6alert_count
  2. duplicate_count ← 2

    8alert_count = 69duplicate_count = 210useful_count = alert_count - duplicate_count
    values this step2duplicate_count
  3. useful_count ← 4

    9duplicate_count = 210useful_count = alert_count - duplicate_count11if (useful_count >= 7) then
    values this step4useful_count6alert_count2duplicate_count
  4. if (useful_count >= 7) then

    10useful_count = alert_count - duplicate_count11if (useful_count >= 7) then12    label = 'noisy'
    values this step4useful_count
  5. else if (duplicate_count >= useful_count) then

    12    label = 'noisy'13else if (duplicate_count >= useful_count) then14    label = 'review'
    values this step2duplicate_count4useful_count
  6. label ← focused

    15else16    label = 'focused'17end if
    values this stepfocusedlabel
  7. print '(A, I0, 1X, A, I0, 1X, A)', 'alerts=', alert_count, 'useful=', …

    17    end if18    print '(A, I0, 1X, A, I0, 1X, A)', 'alerts=', alert_count, 'useful=', useful_count, trim(label)19end program alert_noise_report_demo
    outputalerts=6 useful=4 focused
    values this step6alert_count4useful_countfocusedlabel
  1. alert_count ← 3

    8alert_count = 39duplicate_count = 2
    values this step3alert_count
  2. duplicate_count ← 2

    8alert_count = 39duplicate_count = 210useful_count = alert_count - duplicate_count
    values this step2duplicate_count
  3. useful_count ← 1

    9duplicate_count = 210useful_count = alert_count - duplicate_count11if (useful_count >= 7) then
    values this step1useful_count3alert_count2duplicate_count
  4. if (useful_count >= 7) then

    10useful_count = alert_count - duplicate_count11if (useful_count >= 7) then12    label = 'noisy'
    values this step1useful_count
  5. else if (duplicate_count >= useful_count) then

    12    label = 'noisy'13else if (duplicate_count >= useful_count) then14    label = 'review'
    values this step2duplicate_count1useful_count
  6. label ← review

    13else if (duplicate_count >= useful_count) then14    label = 'review'15else
    values this stepreviewlabel
  7. print '(A, I0, 1X, A, I0, 1X, A)', 'alerts=', alert_count, 'useful=', …

    17    end if18    print '(A, I0, 1X, A, I0, 1X, A)', 'alerts=', alert_count, 'useful=', useful_count, trim(label)19end program alert_noise_report_demo
    outputalerts=3 useful=1 review
    values this step3alert_count1useful_countreviewlabel
  1. alert_count ← 9

    8alert_count = 99duplicate_count = 2
    values this step9alert_count
  2. duplicate_count ← 2

    8alert_count = 99duplicate_count = 210useful_count = alert_count - duplicate_count
    values this step2duplicate_count
  3. useful_count ← 7

    9duplicate_count = 210useful_count = alert_count - duplicate_count11if (useful_count >= 7) then
    values this step7useful_count9alert_count2duplicate_count
  4. if (useful_count >= 7) then

    10useful_count = alert_count - duplicate_count11if (useful_count >= 7) then12    label = 'noisy'
    values this step7useful_count
  5. label ← noisy

    11if (useful_count >= 7) then12    label = 'noisy'13else if (duplicate_count >= useful_count) then
    values this stepnoisylabel
  6. print '(A, I0, 1X, A, I0, 1X, A)', 'alerts=', alert_count, 'useful=', …

    17    end if18    print '(A, I0, 1X, A, I0, 1X, A)', 'alerts=', alert_count, 'useful=', useful_count, trim(label)19end program alert_noise_report_demo
    outputalerts=9 useful=7 noisy
    values this step9alert_count7useful_countnoisylabel
duplicate count The duplicate count is fixed so the selector only changes the incoming alert volume.
useful signal `alert_count - duplicate_count` produces the diagnostic value for the report.
noise label The final label separates focused, noisy, and review cases.