<mode>render</mode>
1,2,3

<mode>image</mode>
title=>Lossy Times
legend=>Number of Lossy End-to-End Paths 
xlabel=>{resolution} Since {start_at}
ylabel=>Number of Lossy Source-Dest Pairs
rmode=>point-pt
data=>1,2

<mode>ascii</mode>
col_names=>{resolution} Since {start_at},Number of Congested E-2-E Paths
col_numbers=>1,2

<mode> query  </mode>
WITH 
MinuteProbeCount(NodePairID, Time, Probes) as 
( 
SELECT 	t.NodePairID as NodePairID, 
	((t.start/{offset}) - ({start_time}/{offset})) as Time, 
	count(*) as Probes 
FROM {schema_name}Times t 
WHERE t.start BETWEEN ({start_time}) AND ({end_time}) 
GROUP BY t.NodePairID, (t.start/{offset}) 
), 
MinuteNonLossCount(NodePairID, Time, NonLoss) as 
( 
SELECT 	t.NodePairID as NodePairID, 
	((t.start/{offset}) - ({start_time}/{offset})) as Time, 
	count(*) as NonLoss 
FROM {schema_name}Times t 
WHERE 	t.start BETWEEN ({start_time}) AND ({end_time}) AND t.Delay != -1 
GROUP BY t.NodePairID, (t.start/60) 
), 
MinuteInfo(NodePairID, Time, Probes, NonLoss) as 
( 
SELECT nlc.NodePairID, nlc.Time, pc.Probes, nlc.NonLoss 
FROM MinuteProbeCount pc, MinuteNonLossCount nlc 
WHERE 	nlc.NodePairID = pc.NodePairID AND nlc.Time = pc.Time 
) 
SELECT 	nlc.Time as "Time Since Midnight", 
	count(DISTINCT nlc.NodePairID) as "Num of Congested PathSpec" 
FROM MinuteNonLossCount nlc, MinuteProbeCount pc 
WHERE  	nlc.NodePairID = pc.NodePairID AND 
	nlc.Time = pc.Time AND 
	(pc.Probes - nlc.NonLoss) > 2 AND 
	((nlc.NonLoss*100)/pc.Probes + 1) <= 99 
GROUP BY nlc.Time 
<mode>endquery</mode>
