summaryrefslogtreecommitdiff
path: root/cesar/tools/data_rate_test
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/tools/data_rate_test')
-rw-r--r--cesar/tools/data_rate_test/Makefile7
-rw-r--r--cesar/tools/data_rate_test/chart.csv398
-rw-r--r--cesar/tools/data_rate_test/chart.odsbin0 -> 30431 bytes
-rw-r--r--cesar/tools/data_rate_test/data_rate_test.h263
-rw-r--r--cesar/tools/data_rate_test/src/data_rate_test.c102
5 files changed, 770 insertions, 0 deletions
diff --git a/cesar/tools/data_rate_test/Makefile b/cesar/tools/data_rate_test/Makefile
new file mode 100644
index 0000000000..3654a2bba5
--- /dev/null
+++ b/cesar/tools/data_rate_test/Makefile
@@ -0,0 +1,7 @@
+BASE = ../..
+
+HOST_PROGRAMS = data_rate_test
+data_rate_test_SOURCES = data_rate_test.c
+data_rate_test_MODULES = lib
+
+include $(BASE)/common/make/top.mk
diff --git a/cesar/tools/data_rate_test/chart.csv b/cesar/tools/data_rate_test/chart.csv
new file mode 100644
index 0000000000..dd2c23a617
--- /dev/null
+++ b/cesar/tools/data_rate_test/chart.csv
@@ -0,0 +1,398 @@
+timeline (ms), new data size(Mbit), data rate(Mbit/s), real rate(Mbit/s)
+100,0,0,0
+200,0,0,0
+300,0,1,1
+400,0,1,1
+500,0,1,1
+600,0,1,2
+700,0,2,2
+800,0,2,3
+900,0,2,3
+1000,0,2,3
+1100,0,2,4
+1200,0,2,4
+1300,0,2,4
+1400,0,3,4
+1500,0,3,4
+1600,0,3,4
+1700,0,3,4
+1800,0,3,4
+1900,0,3,4
+2000,0,3,4
+2100,0,3,4
+2200,0,3,4
+2300,0,3,4
+2400,0,3,3
+2500,0,2,3
+2600,0,2,2
+2700,0,2,2
+2800,0,2,2
+2900,0,1,1
+3000,0,1,1
+3100,0,1,0
+3200,0,1,0
+3300,0,1,0
+3400,0,1,0
+3500,0,1,0
+3600,0,0,0
+3700,0,0,0
+3800,0,0,0
+3900,0,0,0
+4000,56,56,56
+4100,0,50,56
+4200,0,45,56
+4300,0,41,56
+4400,0,37,56
+4500,0,33,56
+4600,0,30,56
+4700,0,27,56
+4800,0,24,56
+4900,0,21,0
+5000,0,19,0
+5100,0,17,0
+5200,56,71,56
+5300,0,64,56
+5400,0,58,56
+5500,0,52,56
+5600,0,47,56
+5700,0,42,56
+5800,0,38,56
+5900,0,34,56
+6000,0,30,56
+6100,0,27,0
+6200,0,25,0
+6300,0,22,0
+6400,56,76,56
+6500,0,68,56
+6600,0,60,56
+6700,0,54,56
+6800,0,48,56
+6900,0,43,56
+7000,0,38,56
+7100,0,35,56
+7200,0,31,56
+7300,0,28,0
+7400,0,24,0
+7500,0,22,0
+7600,0,19,0
+7700,0,17,0
+7800,0,15,0
+7900,0,14,0
+8000,0,12,0
+8100,0,11,0
+8200,0,10,0
+8300,0,9,0
+8400,0,8,0
+8500,0,7,0
+8600,0,6,0
+8700,0,5,0
+8800,0,5,0
+8900,0,4,0
+9000,0,4,0
+9100,0,3,0
+9200,0,3,0
+9300,0,3,0
+9400,0,2,0
+9500,20,21,20
+9600,0,19,20
+9700,20,37,40
+9800,0,33,40
+9900,20,49,60
+10000,0,44,60
+10100,20,59,80
+10200,0,53,80
+10300,20,67,100
+10400,0,61,100
+10500,20,74,100
+10600,0,67,100
+10700,20,80,100
+10800,0,72,100
+10900,20,84,100
+11000,0,76,100
+11100,20,88,100
+11200,0,80,100
+11300,20,91,100
+11400,0,82,100
+11500,20,94,100
+11600,0,84,100
+11700,20,96,100
+11800,0,86,100
+11900,20,97,100
+12000,0,88,100
+12100,20,99,100
+12200,0,89,100
+12300,20,100,100
+12400,0,90,100
+12500,20,101,100
+12600,0,91,100
+12700,20,101,100
+12800,0,91,100
+12900,20,102,100
+13000,0,92,100
+13100,20,102,100
+13200,0,92,100
+13300,20,103,100
+13400,0,93,100
+13500,20,103,100
+13600,0,93,100
+13700,20,103,100
+13800,0,93,100
+13900,20,104,100
+14000,0,94,100
+14100,20,104,100
+14200,0,94,100
+14300,20,104,100
+14400,0,94,100
+14500,20,104,100
+14600,0,94,100
+14700,20,104,100
+14800,0,94,100
+14900,20,104,100
+15000,0,94,100
+15100,20,104,100
+15200,0,94,100
+15300,20,104,100
+15400,0,94,100
+15500,20,104,100
+15600,0,94,100
+15700,20,104,100
+15800,0,94,100
+15900,0,84,80
+16000,0,76,80
+16100,0,68,60
+16200,0,61,60
+16300,0,55,40
+16400,0,50,40
+16500,0,45,20
+16600,0,40,20
+16700,0,36,0
+16800,0,32,0
+16900,0,29,0
+17000,0,26,0
+17100,0,23,0
+17200,0,21,0
+17300,0,19,0
+17400,0,17,0
+17500,0,15,0
+17600,0,14,0
+17700,0,12,0
+17800,0,11,0
+17900,0,10,0
+18000,0,9,0
+18100,0,8,0
+18200,0,7,0
+18300,0,6,0
+18400,0,6,0
+18500,0,5,0
+18600,0,4,0
+18700,0,4,0
+18800,0,4,0
+18900,0,3,0
+19000,0,3,0
+19100,0,2,0
+19200,0,2,0
+19300,20,21,20
+19400,20,38,40
+19500,20,54,60
+19600,20,68,80
+19700,20,80,100
+19800,20,92,120
+19900,20,102,140
+20000,20,112,160
+20100,20,120,180
+20200,20,128,200
+20300,20,135,200
+20400,20,141,200
+20500,20,146,200
+20600,20,152,200
+20700,20,156,200
+20800,20,160,200
+20900,20,164,200
+21000,20,167,200
+21100,20,171,200
+21200,20,173,200
+21300,20,176,200
+21400,20,178,200
+21500,20,180,200
+21600,20,182,200
+21700,20,184,200
+21800,20,185,200
+21900,20,187,200
+22000,20,188,200
+22100,20,189,200
+22200,20,190,200
+22300,20,191,200
+22400,20,192,200
+22500,20,192,200
+22600,20,193,200
+22700,20,194,200
+22800,20,194,200
+22900,20,195,200
+23000,20,195,200
+23100,20,196,200
+23200,20,196,200
+23300,20,196,200
+23400,20,197,200
+23500,20,197,200
+23600,20,197,200
+23700,20,197,200
+23800,20,198,200
+23900,20,198,200
+24000,20,198,200
+24100,20,198,200
+24200,20,198,200
+24300,20,198,200
+24400,20,198,200
+24500,20,199,200
+24600,20,199,200
+24700,20,199,200
+24800,20,199,200
+24900,20,199,200
+25000,20,199,200
+25100,20,199,200
+25200,20,199,200
+25300,20,199,200
+25400,20,199,200
+25500,20,199,200
+25600,20,199,200
+25700,20,199,200
+25800,0,180,180
+25900,0,163,160
+26000,0,147,140
+26100,0,133,120
+26200,0,120,100
+26300,0,108,80
+26400,0,98,60
+26500,0,89,40
+26600,0,80,20
+26700,0,72,0
+26800,0,65,0
+26900,0,59,0
+27000,0,53,0
+27100,0,48,0
+27200,0,43,0
+27300,0,39,0
+27400,0,35,0
+27500,0,32,0
+27600,0,29,0
+27700,0,26,0
+27800,0,23,0
+27900,0,21,0
+28000,0,19,0
+28100,0,17,0
+28200,0,15,0
+28300,0,14,0
+28400,0,13,0
+28500,0,11,0
+28600,0,10,0
+28700,0,9,0
+28800,0,8,0
+28900,0,7,0
+29000,0,7,0
+29100,0,6,0
+29200,0,5,0
+29300,0,5,0
+29400,0,4,0
+29500,0,4,0
+29600,0,3,0
+29700,0,3,0
+29800,0,3,0
+29900,0,2,0
+30000,0,2,0
+30100,0,2,0
+30200,0,2,0
+30300,0,1,0
+30400,0,1,0
+30500,0,1,0
+30600,0,1,0
+30700,0,1,0
+30800,20,21,20
+30900,20,39,40
+31000,20,55,60
+31100,20,69,80
+31200,20,82,100
+31300,20,94,120
+31400,20,104,140
+31500,20,114,160
+31600,20,123,180
+31700,20,130,200
+31800,20,137,200
+31900,20,143,200
+32000,20,149,200
+32100,20,154,200
+32200,20,159,200
+32300,20,163,200
+32400,20,166,200
+32500,20,170,200
+32600,20,173,200
+32700,20,175,200
+32800,20,178,200
+32900,20,180,200
+33000,20,182,200
+33100,20,184,200
+33200,20,185,200
+33300,20,187,200
+33400,20,188,200
+33500,20,189,200
+33600,20,190,200
+33700,20,191,200
+33800,20,192,200
+33900,20,193,200
+34000,20,193,200
+34100,20,194,200
+34200,20,195,200
+34300,20,195,200
+34400,20,195,200
+34500,20,196,200
+34600,20,196,200
+34700,20,197,200
+34800,20,197,200
+34900,20,197,200
+35000,20,197,200
+35100,20,198,200
+35200,20,198,200
+35300,20,198,200
+35400,20,198,200
+35500,20,198,200
+35600,20,198,200
+35700,20,198,200
+35800,20,199,200
+35900,20,199,200
+36000,20,199,200
+36100,20,199,200
+36200,20,199,200
+36300,20,199,200
+36400,20,199,200
+36500,20,199,200
+36600,20,199,200
+36700,20,199,200
+36800,20,199,200
+36900,20,199,200
+37000,20,199,200
+37100,20,199,200
+37200,20,199,200
+37300,0,179,180
+37400,0,161,160
+37500,0,145,140
+37600,0,131,120
+37700,0,117,100
+37800,0,106,80
+37900,0,95,60
+38000,0,86,40
+38100,0,77,20
+38200,0,69,0
+38300,0,62,0
+38400,0,56,0
+38500,0,50,0
+38600,0,45,0
+38700,0,41,0
+38800,0,37,0
+38900,0,33,0
+39000,0,29,0
+39100,0,26,0
+39200,0,24,0
+39300,0,21,0
+39400,0,19,0
+39500,0,17,0
+39600,0,15,0
+39700,0,14,0
diff --git a/cesar/tools/data_rate_test/chart.ods b/cesar/tools/data_rate_test/chart.ods
new file mode 100644
index 0000000000..ac17402f1e
--- /dev/null
+++ b/cesar/tools/data_rate_test/chart.ods
Binary files differ
diff --git a/cesar/tools/data_rate_test/data_rate_test.h b/cesar/tools/data_rate_test/data_rate_test.h
new file mode 100644
index 0000000000..788e9641ba
--- /dev/null
+++ b/cesar/tools/data_rate_test/data_rate_test.h
@@ -0,0 +1,263 @@
+/*
+ * sample.h
+ *
+ * Created on: 28 août 2009
+ * Author: mercadie
+ */
+
+#ifndef SAMPLE_H_
+#define SAMPLE_H_
+
+
+typedef struct
+{
+ u32 data_size; /* in octets */
+ u32 delta_time; /* in usec */
+}
+sample_t;
+/* max */
+sample_t sample[] =
+{
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000},{ 10000, 20000}, /* 250 kB/sec */
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 7000000, 200000}, //35MB/s
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 7000000, 200000}, //35MB/s
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 7000000, 200000}, //35MB/s
+ { 000000, 200000},{ 000000, 200000},{ 000000, 200000},{ 000000, 200000},{ 000000, 200000},
+ { 000000, 200000},{ 000000, 200000},{ 000000, 200000},{ 000000, 200000},{ 000000, 200000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},// 25MB/s
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},{ 500000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000}, // 00MB/s
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},{ 000000, 20000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000}, //25MB/s
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},{ 2500000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},{ 000000, 100000},
+ { 0, 0}
+};
+#endif /* SAMPLE_H_ */
diff --git a/cesar/tools/data_rate_test/src/data_rate_test.c b/cesar/tools/data_rate_test/src/data_rate_test.c
new file mode 100644
index 0000000000..511aa93679
--- /dev/null
+++ b/cesar/tools/data_rate_test/src/data_rate_test.c
@@ -0,0 +1,102 @@
+/*
+ * data_rate_test.c
+ *
+ * Created on: 28 août 2009
+ * Author: mercadie
+ *
+ * This test simulate data rate calculation
+ * the calculation is made using data contained in an array "sample"
+ * Each element of this array is a sample containing :
+ * - the data quantity received/sent on interruption
+ * - the delay since last reception/emission
+ *
+ * This test simulate a data rate requested every 100 ms independtly of the data reception/emission
+ * The main loop cycle with data rate requests
+ * Between each request many rec/send interruptions may have occured.
+ * For each request we have to calculate the data rate update for each interruption that occured between
+ * requests.
+ * Then calculate the final data rate depending on the time elapsed since last interruption
+ * All data size vars are in octets numbers.
+ * All time vars are in micro seconds
+ */
+
+#include <stdio.h>
+#include "common/std.h"
+#include "data_rate_test.h"
+
+int
+main ()
+{
+ int iter;
+ u64 data_rate = 0; /* This is the data rate value updated every time data is received */
+ u64 real_rate; /* This is the real data quantity received over the passed second */
+ u64 one_second = 1000000; /* one second in micro seconds */
+ u64 current_time = 0; /* this simulated the current time where the data rate is requested */
+ u64 data_time = 0; /* this record the time according to samples reception */
+ u64 total_time = 0; /* this is used to go back in time for one second */
+ u64 current_time_data = 0; /* total data quantity received between the previous data rate request and now */
+ u64 current_data_rate = 0; /* data rate at the requested time */
+ int sample_index = 0; /* index of the samples array */
+
+ FILE *chart;
+
+ chart = fopen("chart.csv", "w");
+ fprintf(chart, "timeline (ms), new data size(Mbit), data rate(Mbit/s), real rate(Mbit/s)\n");
+
+ /* This loop simulate a DR request every 100ms */
+ do
+ {
+ current_time += 100000;
+ current_time_data = 0;
+
+ /* This loop simulate what happended since last data rate request */
+ while (sample[sample_index].delta_time && (data_time + sample[sample_index].delta_time <= current_time))
+ {
+ /* Moving average calculation on a one second period */
+ if (sample[sample_index].delta_time < one_second)
+ data_rate = data_rate
+ - (data_rate*sample[sample_index].delta_time)/one_second
+ + sample [sample_index].data_size;
+ else
+ /* more than one second delay */
+ data_rate = sample [sample_index].data_size * sample[sample_index].delta_time / one_second;
+
+ /* sum data size since last request */
+ current_time_data += sample [sample_index].data_size;
+
+ /* update data time line and sample index */
+ data_time += sample[sample_index].delta_time;
+ sample_index++;
+ }
+
+ /* Update data rate including delay between last interruption and request */
+ if (current_time > data_time + one_second)
+ current_data_rate = 0;
+ else
+ current_data_rate = data_rate - data_rate * (current_time - data_time) / one_second;
+
+ /* calculate real data quantity on last second */
+ total_time = current_time - data_time;
+ real_rate = 0;
+ iter = sample_index-1;
+ while ((iter) && ((total_time + sample [iter].delta_time) <= one_second))
+ {
+ total_time += sample [iter].delta_time;
+ real_rate += sample [iter].data_size;
+ iter--;
+ }
+
+ /* Print the results to a file */
+ fprintf(chart, "%u,%u,%u,%u\n", ((u32)current_time)/1000, /* time line in msec */
+ ((u32)current_time_data*8)/1000000, /* data quantity since last request in Mb */
+ ((u32)current_data_rate*8)/1000000, /* calculated data rate in Mb/sec */
+ ((u32)real_rate*8)/1000000); /* exact data quantity in last second in Mb/sec */
+ }
+ while(sample [sample_index].delta_time); /* exit when next sample contain a null delay */
+
+ printf("ok\n");
+
+ fclose(chart);
+
+ return 0;
+}