Examples
Input: [("PUT", 10, "a", "1"), ("PUT", 11, "b", "2"), ("DELETE", 13, "a"), ("AVG_QPS", 13, 5)]
Expected Output: [0.6]
Explanation: Mutation timestamps are 10, 11, and 13. In the interval (8, 13], all 3 are included, so the answer is 3 / 5 = 0.6.
Input: [("PUT", 5, "x", 1), ("AVG_QPS", 5, 5), ("DELETE", 5, "y"), ("AVG_QPS", 5, 5)]
Expected Output: [0.2, 0.4]
Explanation: At the first query, only the earlier PUT at timestamp 5 has been processed, so the count is 1. At the second query, both the PUT and DELETE at timestamp 5 have been processed, so the count is 2.
Input: [("PUT", 1, "a", 1), ("PUT", 3, "b", 2), ("DELETE", 6, "a"), ("AVG_QPS", 6, 3), ("AVG_QPS", 6, 5)]
Expected Output: [0.3333333333333333, 0.4]
Explanation: For window 3, the interval is (3, 6], so timestamp 3 is excluded and only timestamp 6 counts: 1 / 3. For window 5, the interval is (1, 6], so timestamps 3 and 6 count: 2 / 5.
Input: [("DELETE", 2, "ghost"), ("PUT", 4, "a", 7), ("DELETE", 10, "a"), ("AVG_QPS", 10, 10), ("AVG_QPS", 10, 6)]
Expected Output: [0.3, 0.16666666666666666]
Explanation: DELETE on a missing key still counts as a mutation. In (0, 10], all three mutations count, so 3 / 10 = 0.3. In (4, 10], timestamp 4 is excluded, so only the DELETE at 10 counts: 1 / 6.
Input: [("AVG_QPS", 7, 4)]
Expected Output: [0.0]
Explanation: No mutation operations have occurred before the query, so the count is 0 and the average QPS is 0.0.
Input: []
Expected Output: []
Explanation: With no operations, there are no AVG_QPS results to return.