Compare queue depth against soft and hard limits and pick a saturation relief action.

relief action Crossing the soft limit sheds load and crossing the hard limit pauses intake.

Saturation Relief Remediation Report

queueDepth
SaturationReliefRemediationReport.java
Replay: real traced execution (multi-file project)
public class SaturationReliefRemediationReport {
    public static void main(String[] args) {
        int queueDepth = 40;
        int softLimit = 60;
        int hardLimit = 90;
        String action = "steady";

        if (queueDepth >= softLimit) {
            action = "shed";
        }
        if (queueDepth >= hardLimit) {
            action = "pause";
        }

        System.out.println("depth=" + queueDepth + " soft=" + softLimit + " action=" + action);
    }
}
public class SaturationReliefRemediationReport {
    public static void main(String[] args) {
        int queueDepth = 70;
        int softLimit = 60;
        int hardLimit = 90;
        String action = "steady";

        if (queueDepth >= softLimit) {
            action = "shed";
        }
        if (queueDepth >= hardLimit) {
            action = "pause";
        }

        System.out.println("depth=" + queueDepth + " soft=" + softLimit + " action=" + action);
    }
}
public class SaturationReliefRemediationReport {
    public static void main(String[] args) {
        int queueDepth = 95;
        int softLimit = 60;
        int hardLimit = 90;
        String action = "steady";

        if (queueDepth >= softLimit) {
            action = "shed";
        }
        if (queueDepth >= hardLimit) {
            action = "pause";
        }

        System.out.println("depth=" + queueDepth + " soft=" + softLimit + " action=" + action);
    }
}
  1. queueDepth ← 40, softLimit ← 60, hardLimit ← 90, action ← steady

    1public class SaturationReliefRemediationReport {2    public static void main(String[] args) {3        int queueDepth→ 40 = 40;  //@queueDepth=70, 954        int softLimit→ 60 = 60;5        int hardLimit→ 90 = 90;6        String action→ steady = "steady";78        if (queueDepth >= softLimit) {9            action = "shed";10        }11        if (queueDepth >= hardLimit) {12            action = "pause";13        }1415        System.out.println("depth=" + queueDepth40 + " soft=" + softLimit60 + " action=" + actionsteady);16    }
    outputdepth=40 soft=60 action=steady
  1. queueDepth ← 70, softLimit ← 60, hardLimit ← 90, action ← steady

    1public class SaturationReliefRemediationReport {2    public static void main(String[] args) {3        int queueDepth→ 70 = 70;4        int softLimit→ 60 = 60;5        int hardLimit→ 90 = 90;6        String action→ steady = "steady";
  2. action ← shed

    8if (queueDepth70 >= softLimit60) {9    action→ shed = "shed";10}
  3. System.out.println("depth=" + queueDepth + " soft=" + softLimit + " ac…

    15    System.out.println("depth=" + queueDepth70 + " soft=" + softLimit60 + " action=" + actionshed);16}
    outputdepth=70 soft=60 action=shed
  1. queueDepth ← 95, softLimit ← 60, hardLimit ← 90, action ← steady

    1public class SaturationReliefRemediationReport {2    public static void main(String[] args) {3        int queueDepth→ 95 = 95;4        int softLimit→ 60 = 60;5        int hardLimit→ 90 = 90;6        String action→ steady = "steady";
  2. action ← shed

    8if (queueDepth95 >= softLimit60) {9    action→ shed = "shed";10}
  3. action ← pause

    10}11if (queueDepth95 >= hardLimit90) {12    action→ pause = "pause";13}
  4. System.out.println("depth=" + queueDepth + " soft=" + softLimit + " ac…

    15    System.out.println("depth=" + queueDepth95 + " soft=" + softLimit60 + " action=" + actionpause);16}
    outputdepth=95 soft=60 action=pause