From: Anja Bruls Date: Wed, 5 Dec 2018 15:26:04 +0000 (+0100) Subject: fixed merging X-Git-Tag: archive/raspbian/2.0.44-1+rpi1~1^2~3^2~7^2~8^2^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=aded73528dbe9a23595f06d165e5797d8191ca37;p=siridb-server.git fixed merging --- diff --git a/dbtest/.accounts.dat b/dbtest/.accounts.dat new file mode 100644 index 00000000..dcb4dd45 --- /dev/null +++ b/dbtest/.accounts.dat @@ -0,0 +1 @@ +üï‚sa¿EI5djmJS$1DhOYRlSPpQ7LKlNlnT.npvRhg8uQPlWkoQRNhKPXnNknMtrRuKUTR \ No newline at end of file diff --git a/dbtest/dbpath0/.accounts.dat b/dbtest/dbpath0/.accounts.dat new file mode 100644 index 00000000..2eb141db --- /dev/null +++ b/dbtest/dbpath0/.accounts.dat @@ -0,0 +1 @@ +üï‚sa¿4xt4e1rb$1HuVsdC7ZpFcCbsI1.Vmo7hBGsbsYFFbmV/7dcHKvQJlHzw1VQ8uoG \ No newline at end of file diff --git a/dbtest/dbpath0/anja/.dropped b/dbtest/dbpath0/anja/.dropped new file mode 100644 index 00000000..e69de29b diff --git a/dbtest/dbpath0/anja/.max_series_id b/dbtest/dbpath0/anja/.max_series_id new file mode 100644 index 00000000..d540dfdb Binary files /dev/null and b/dbtest/dbpath0/anja/.max_series_id differ diff --git a/dbtest/dbpath0/anja/buffer.dat b/dbtest/dbpath0/anja/buffer.dat new file mode 100644 index 00000000..0ab18020 Binary files /dev/null and b/dbtest/dbpath0/anja/buffer.dat differ diff --git a/dbtest/dbpath0/anja/database.conf b/dbtest/dbpath0/anja/database.conf new file mode 100644 index 00000000..b56a91bd --- /dev/null +++ b/dbtest/dbpath0/anja/database.conf @@ -0,0 +1,16 @@ +# +# Welcome to the SiriDB configuration file +# + +[buffer] +# Alternative path to save the buffer file. +# In case you later plan to change this location you manually need to move +# the buffer file to the new location. +# path = + +# Buffer size in bytes. This size must be a multiple of 512 with a maximum +# of 1048576 bytes. Be careful using large values since SiriDB will require +# memory based on this value. A value between 1024 and 32768 is recommended. +# size = 1024 + +size = 1024 diff --git a/dbtest/dbpath0/anja/database.dat b/dbtest/dbpath0/anja/database.dat new file mode 100644 index 00000000..27f24b4c Binary files /dev/null and b/dbtest/dbpath0/anja/database.dat differ diff --git a/dbtest/dbpath0/anja/groups.dat b/dbtest/dbpath0/anja/groups.dat new file mode 100644 index 00000000..3c82d7ae --- /dev/null +++ b/dbtest/dbpath0/anja/groups.dat @@ -0,0 +1 @@ +ü \ No newline at end of file diff --git a/dbtest/dbpath0/anja/series.dat b/dbtest/dbpath0/anja/series.dat new file mode 100644 index 00000000..22057fe7 Binary files /dev/null and b/dbtest/dbpath0/anja/series.dat differ diff --git a/dbtest/dbpath0/anja/servers.dat b/dbtest/dbpath0/anja/servers.dat new file mode 100644 index 00000000..05c9a45c Binary files /dev/null and b/dbtest/dbpath0/anja/servers.dat differ diff --git a/dbtest/dbpath0/anja/users.dat b/dbtest/dbpath0/anja/users.dat new file mode 100644 index 00000000..4ce0f39c --- /dev/null +++ b/dbtest/dbpath0/anja/users.dat @@ -0,0 +1 @@ +üð„iris¿/ITTEIBl$1Q7urI1k4h4PCfGgCI5ifj7Iyc8wqJVdAU5h/TSinJUe5ObdeH5V0Méÿ \ No newline at end of file diff --git a/dbtest/dbpath0/benchmark/.dropped b/dbtest/dbpath0/benchmark/.dropped new file mode 100644 index 00000000..e69de29b diff --git a/dbtest/dbpath0/benchmark/.max_series_id b/dbtest/dbpath0/benchmark/.max_series_id new file mode 100644 index 00000000..01387f5b Binary files /dev/null and b/dbtest/dbpath0/benchmark/.max_series_id differ diff --git a/dbtest/dbpath0/benchmark/buffer.dat b/dbtest/dbpath0/benchmark/buffer.dat new file mode 100644 index 00000000..23db84ea Binary files /dev/null and b/dbtest/dbpath0/benchmark/buffer.dat differ diff --git a/dbtest/dbpath0/benchmark/database.conf b/dbtest/dbpath0/benchmark/database.conf new file mode 100644 index 00000000..b56a91bd --- /dev/null +++ b/dbtest/dbpath0/benchmark/database.conf @@ -0,0 +1,16 @@ +# +# Welcome to the SiriDB configuration file +# + +[buffer] +# Alternative path to save the buffer file. +# In case you later plan to change this location you manually need to move +# the buffer file to the new location. +# path = + +# Buffer size in bytes. This size must be a multiple of 512 with a maximum +# of 1048576 bytes. Be careful using large values since SiriDB will require +# memory based on this value. A value between 1024 and 32768 is recommended. +# size = 1024 + +size = 1024 diff --git a/dbtest/dbpath0/benchmark/database.dat b/dbtest/dbpath0/benchmark/database.dat new file mode 100644 index 00000000..69d85810 Binary files /dev/null and b/dbtest/dbpath0/benchmark/database.dat differ diff --git a/dbtest/dbpath0/benchmark/groups.dat b/dbtest/dbpath0/benchmark/groups.dat new file mode 100644 index 00000000..3c82d7ae --- /dev/null +++ b/dbtest/dbpath0/benchmark/groups.dat @@ -0,0 +1 @@ +ü \ No newline at end of file diff --git a/dbtest/dbpath0/benchmark/series.dat b/dbtest/dbpath0/benchmark/series.dat new file mode 100644 index 00000000..6d1def40 Binary files /dev/null and b/dbtest/dbpath0/benchmark/series.dat differ diff --git a/dbtest/dbpath0/benchmark/servers.dat b/dbtest/dbpath0/benchmark/servers.dat new file mode 100644 index 00000000..e81f0aa8 Binary files /dev/null and b/dbtest/dbpath0/benchmark/servers.dat differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000000.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000000.idx new file mode 100644 index 00000000..3dc3071b Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000000.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000000.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000000.sdb new file mode 100644 index 00000000..414401a9 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000000.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000001.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000001.idx new file mode 100644 index 00000000..0c2f75e3 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000001.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000001.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000001.sdb new file mode 100644 index 00000000..99854711 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000001.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000002.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000002.idx new file mode 100644 index 00000000..9ae6160d Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000002.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000002.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000002.sdb new file mode 100644 index 00000000..b6716945 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000002.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000003.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000003.idx new file mode 100644 index 00000000..ef590439 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000003.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000003.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000003.sdb new file mode 100644 index 00000000..f6bce1c1 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000003.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000004.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000004.idx new file mode 100644 index 00000000..68840942 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000004.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000004.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000004.sdb new file mode 100644 index 00000000..843b7ea9 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000004.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000005.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000005.idx new file mode 100644 index 00000000..5f36889f Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000005.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000005.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000005.sdb new file mode 100644 index 00000000..bb1cd000 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000005.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000006.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000006.idx new file mode 100644 index 00000000..a4af0655 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000006.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000006.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000006.sdb new file mode 100644 index 00000000..c41c5906 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000006.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000007.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000007.idx new file mode 100644 index 00000000..6f92932e Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000007.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000007.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000007.sdb new file mode 100644 index 00000000..163f5d9d Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000007.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000008.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000008.idx new file mode 100644 index 00000000..4564c673 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000008.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000008.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000008.sdb new file mode 100644 index 00000000..f0920f9b Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000008.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000009.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000009.idx new file mode 100644 index 00000000..46c7334d Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000009.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000009.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000009.sdb new file mode 100644 index 00000000..ff6a2df0 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000009.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000010.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000010.idx new file mode 100644 index 00000000..ded7b9ce Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000010.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000010.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000010.sdb new file mode 100644 index 00000000..43dd682d Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000010.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000011.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000011.idx new file mode 100644 index 00000000..91d2364b Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000011.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000011.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000011.sdb new file mode 100644 index 00000000..0f101995 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000011.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000012.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000012.idx new file mode 100644 index 00000000..9b301151 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000012.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000012.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000012.sdb new file mode 100644 index 00000000..78699958 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000012.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000013.idx b/dbtest/dbpath0/benchmark/shards/1451520000000000013.idx new file mode 100644 index 00000000..cde04a77 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000013.idx differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000013.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000013.sdb new file mode 100644 index 00000000..c9c1dcb7 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000013.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000014.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000014.sdb new file mode 100644 index 00000000..0ee2c0d3 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000014.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000015.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000015.sdb new file mode 100644 index 00000000..b7e12434 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000015.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000016.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000016.sdb new file mode 100644 index 00000000..351ca75e Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000016.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000017.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000017.sdb new file mode 100644 index 00000000..09f22c51 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000017.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000018.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000018.sdb new file mode 100644 index 00000000..72497170 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000018.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000019.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000019.sdb new file mode 100644 index 00000000..49bc9d2c Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000019.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000020.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000020.sdb new file mode 100644 index 00000000..8123b4d8 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000020.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000021.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000021.sdb new file mode 100644 index 00000000..bc55f159 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000021.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000022.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000022.sdb new file mode 100644 index 00000000..27dda82e Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000022.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000023.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000023.sdb new file mode 100644 index 00000000..f1563da2 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000023.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000024.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000024.sdb new file mode 100644 index 00000000..34a28694 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000024.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000025.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000025.sdb new file mode 100644 index 00000000..6d8a6ffd Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000025.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000026.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000026.sdb new file mode 100644 index 00000000..bc543fd3 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000026.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000027.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000027.sdb new file mode 100644 index 00000000..b2275b7b Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000027.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000028.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000028.sdb new file mode 100644 index 00000000..f2b4a55e Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000028.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000029.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000029.sdb new file mode 100644 index 00000000..b65c2171 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000029.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000030.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000030.sdb new file mode 100644 index 00000000..430cc4b7 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000030.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/1451520000000000031.sdb b/dbtest/dbpath0/benchmark/shards/1451520000000000031.sdb new file mode 100644 index 00000000..0364bd06 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/1451520000000000031.sdb differ diff --git a/dbtest/dbpath0/benchmark/shards/__1451520000000000014.sdb b/dbtest/dbpath0/benchmark/shards/__1451520000000000014.sdb new file mode 100644 index 00000000..01dd9294 Binary files /dev/null and b/dbtest/dbpath0/benchmark/shards/__1451520000000000014.sdb differ diff --git a/dbtest/dbpath0/benchmark/users.dat b/dbtest/dbpath0/benchmark/users.dat new file mode 100644 index 00000000..04d03e14 --- /dev/null +++ b/dbtest/dbpath0/benchmark/users.dat @@ -0,0 +1 @@ +üð„iris¿gre84FaJ$1iMGwWNldUGnKIJjNj7bLkNHIW6PwOJiDOITEk4XLnIE9gLeBZIuFKéÿ \ No newline at end of file diff --git a/dbtest/dbpath1/.accounts.dat b/dbtest/dbpath1/.accounts.dat new file mode 100644 index 00000000..3c4e4436 --- /dev/null +++ b/dbtest/dbpath1/.accounts.dat @@ -0,0 +1 @@ +üï‚sa¿vZEWv13W$172ZCeYcCY4qc9yWq4Rn.V4DecWWXIU55S/c93sBDcPzyZZ8b6teaR \ No newline at end of file diff --git a/dbtest/dbpath1/benchmark/.dropped b/dbtest/dbpath1/benchmark/.dropped new file mode 100644 index 00000000..e69de29b diff --git a/dbtest/dbpath1/benchmark/buffer.dat b/dbtest/dbpath1/benchmark/buffer.dat new file mode 100644 index 00000000..f28c4699 Binary files /dev/null and b/dbtest/dbpath1/benchmark/buffer.dat differ diff --git a/dbtest/dbpath1/benchmark/database.conf b/dbtest/dbpath1/benchmark/database.conf new file mode 100644 index 00000000..b56a91bd --- /dev/null +++ b/dbtest/dbpath1/benchmark/database.conf @@ -0,0 +1,16 @@ +# +# Welcome to the SiriDB configuration file +# + +[buffer] +# Alternative path to save the buffer file. +# In case you later plan to change this location you manually need to move +# the buffer file to the new location. +# path = + +# Buffer size in bytes. This size must be a multiple of 512 with a maximum +# of 1048576 bytes. Be careful using large values since SiriDB will require +# memory based on this value. A value between 1024 and 32768 is recommended. +# size = 1024 + +size = 1024 diff --git a/dbtest/dbpath1/benchmark/database.dat b/dbtest/dbpath1/benchmark/database.dat new file mode 100644 index 00000000..75b2fccb Binary files /dev/null and b/dbtest/dbpath1/benchmark/database.dat differ diff --git a/dbtest/dbpath1/benchmark/groups.dat b/dbtest/dbpath1/benchmark/groups.dat new file mode 100644 index 00000000..3c82d7ae --- /dev/null +++ b/dbtest/dbpath1/benchmark/groups.dat @@ -0,0 +1 @@ +ü \ No newline at end of file diff --git a/dbtest/dbpath1/benchmark/series.dat b/dbtest/dbpath1/benchmark/series.dat new file mode 100644 index 00000000..b1e51fa9 Binary files /dev/null and b/dbtest/dbpath1/benchmark/series.dat differ diff --git a/dbtest/dbpath1/benchmark/servers.dat b/dbtest/dbpath1/benchmark/servers.dat new file mode 100644 index 00000000..d6fb0469 Binary files /dev/null and b/dbtest/dbpath1/benchmark/servers.dat differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000000.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000000.sdb new file mode 100644 index 00000000..cc72f877 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000000.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000001.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000001.sdb new file mode 100644 index 00000000..570d307a Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000001.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000002.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000002.sdb new file mode 100644 index 00000000..0bd7772d Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000002.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000003.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000003.sdb new file mode 100644 index 00000000..4c32ce69 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000003.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000004.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000004.sdb new file mode 100644 index 00000000..9f82b6f9 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000004.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000005.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000005.sdb new file mode 100644 index 00000000..3147145f Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000005.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000006.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000006.sdb new file mode 100644 index 00000000..6e16076d Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000006.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000007.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000007.sdb new file mode 100644 index 00000000..28e0170d Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000007.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000008.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000008.sdb new file mode 100644 index 00000000..d77d432d Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000008.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000009.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000009.sdb new file mode 100644 index 00000000..b65dc65a Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000009.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000010.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000010.sdb new file mode 100644 index 00000000..5bf9df7e Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000010.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000011.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000011.sdb new file mode 100644 index 00000000..7e053382 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000011.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000012.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000012.sdb new file mode 100644 index 00000000..e3ece243 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000012.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000013.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000013.sdb new file mode 100644 index 00000000..994b42e8 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000013.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000014.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000014.sdb new file mode 100644 index 00000000..29ede035 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000014.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000015.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000015.sdb new file mode 100644 index 00000000..fee28bfe Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000015.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000016.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000016.sdb new file mode 100644 index 00000000..98016cfe Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000016.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000017.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000017.sdb new file mode 100644 index 00000000..d91ee145 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000017.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000018.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000018.sdb new file mode 100644 index 00000000..e0f8943f Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000018.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000019.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000019.sdb new file mode 100644 index 00000000..9a4a7e66 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000019.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000020.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000020.sdb new file mode 100644 index 00000000..ee308d67 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000020.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000021.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000021.sdb new file mode 100644 index 00000000..7d02fadd Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000021.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000022.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000022.sdb new file mode 100644 index 00000000..00fa6733 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000022.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000023.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000023.sdb new file mode 100644 index 00000000..998a2c8c Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000023.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000024.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000024.sdb new file mode 100644 index 00000000..d33904c5 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000024.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000025.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000025.sdb new file mode 100644 index 00000000..d79f5375 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000025.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000026.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000026.sdb new file mode 100644 index 00000000..41de6b42 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000026.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000027.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000027.sdb new file mode 100644 index 00000000..068fc898 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000027.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000028.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000028.sdb new file mode 100644 index 00000000..049b662d Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000028.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000029.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000029.sdb new file mode 100644 index 00000000..3485be02 Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000029.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000030.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000030.sdb new file mode 100644 index 00000000..ef50350a Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000030.sdb differ diff --git a/dbtest/dbpath1/benchmark/shards/1451520000000000031.sdb b/dbtest/dbpath1/benchmark/shards/1451520000000000031.sdb new file mode 100644 index 00000000..bfc1658e Binary files /dev/null and b/dbtest/dbpath1/benchmark/shards/1451520000000000031.sdb differ diff --git a/dbtest/dbpath1/benchmark/users.dat b/dbtest/dbpath1/benchmark/users.dat new file mode 100644 index 00000000..7f06059c --- /dev/null +++ b/dbtest/dbpath1/benchmark/users.dat @@ -0,0 +1 @@ +üð„iris¿ZkjWsLgK$1/L2Uzs0bnkc01bpT/0KOlPC5hTe1d.xb6COEOdQ2Uc1aRFE9HpxZLéÿ \ No newline at end of file diff --git a/dbtest/siridb-http.conf b/dbtest/siridb-http.conf new file mode 100644 index 00000000..a03dfbb9 --- /dev/null +++ b/dbtest/siridb-http.conf @@ -0,0 +1,78 @@ +# SiriDB HTTP Configuration file +[Database] +# User with at least 'show' privileges. +user = iris + +# A password is required. To protect the password this file should be placed in +# a folder where unauthorized users have no access. +password = siri + +# Database to connect to. +dbname = benchmark + +# Multiple servers are allowed and should be comma separated. When a port +# is not provided the default 9000 is used. IPv6 address are supported and +# should be wrapped in square brackets [] in case an alternative port is +# required. SiriDB HTTP will randomly select an available siridb server +# for each request. +# +# Valid examples: +# siridb01.local,siridb02.local,siridb03.local,siridb04.local +# 10.20.30.40 +# [::1]:5050,[::1]:5051 +# 2001:0db8:85a3:0000:0000:8a2e:0370:7334 +servers = localhost:9001 + +[Configuration] +# Listening to TCP port. +port = 5050 + +# When disabled no authentication is required. When enabled session +# authentication or basic authentication is required. +require_authentication = True + +# When enabled /socket.io/ will be enabled and Socket-IO can be used as an +# alternative to the standard http rest api. +enable_socket_io = True + +# When enabled the crt_file and key_file must be configured and the server +# will be hosted on https. +enable_ssl = False + +# When enabled a website is hosted on the configured port. When disabled the +# resource URIs like /query, /insert, /auth/.. etc. are still available. +enable_web = True + +# When enabled the /query and /insert resource URIs can be used with basic +# authentication. +enable_basic_auth = False + +# When multi user is disabled, only the user/password combination provided in +# this configuration file can be used. +enable_multi_user = False + +# Cookie max age is used to set the cookie expiration time in seconds. +cookie_max_age = 604800 + +# The query api allows you to specify a timeout for each query, but the insert +# api only accepts data. Therefore the insert timeout is set as a general +# value and is applicable to each insert. +insert_timeout = 60 + +[SSL] +# Self-signed certificates can be created with the following command: +# +# openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ +# -keyout certificate.key -out certificate.crt +# +crt_file = certificate.crt +key_file = certificate.key + +# +# Welcome and thank you for using SiriDB! +# +# A configuration file is required and shoud be provided with the +# --config argument. +# Above you find an example template which can be used. +# + diff --git a/dbtest/siridb0.conf b/dbtest/siridb0.conf new file mode 100644 index 00000000..ead07f2b --- /dev/null +++ b/dbtest/siridb0.conf @@ -0,0 +1,86 @@ +# Welcome to the SiriDB configuration file + +[siridb] +# +# SiriDB will use this address:port for it's back-end connections. +# This must be an address that other servers can use to connect to. +# For example IPv4, IPv6 or a fqdn are all possible. When using IPv6 be sure +# to wrap the ip address with square brackets. For example [::1]:9010 +# The default value is %HOSTNAME:9010. The variable %HOSTNAME will be translate +# to the systems host name. +# +# +server_name = %HOSTNAME:9011 + +# +# Listen for SiriDB-server connections only on localhost. +# Use value 0.0.0.0 (or :: for IPv6) to bind to all interfaces. +# +bind_server_address = 0.0.0.0 + +# +# SiriDB will listen for client connections on this port number. +# +listen_client_port = 9001 + +# +# Listen for client connections only on localhost. +# Use value 0.0.0.0 (or :: for IPv6) to bind to all interfaces. +# +bind_client_address = 0.0.0.0 + +# +# When ip_support is set to ALL, SiriDB will listen and connect to both IPv4 +# and IPv6 addresses. +# Valid options are ALL, IPV4ONLY and IPV6ONLY. +# +ip_support = ALL + +# +# SiriDB will load databases from, and create databases in this location. +# +default_db_path = ./dbpath0 + +# +# SiriDB will run an optimize task each X seconds. A value of 0 (zero) disables +# optimizing. +# +optimize_interval = 3600 + +# +# SiriDB uses a heart-beat interval to keep connections with other servers +# online. +# +heartbeat_interval = 30 + +# +# SiriDB can run fsync on the buffer file on an interval in milliseconds. +# This value is set to 0 by default which tells SiriDB to run fsync after +# each insert request. When having many insert requests per second, it can be +# useful to use an interval like 500 milliseconds. +# +#buffer_sync_interval = 500 +buffer_sync_interval = 500 + +# +# SiriDB will not open more shard files than max_open_files. Note that the +# total number of open files can be sligtly higher since SiriDB also needs +# a few other files to write to. +# +max_open_files = 32768 + +# +# Use shard compression for storing data points. +# Set value 0 to disable shard compression. +# +enable_shard_compression = 1 + +# +# Enable named pipe support for client connections. +# +enable_pipe_support = 0 + +# +# SiriDB will bind the client named pipe in this location. +# +pipe_client_name = siridb_client.sock diff --git a/dbtest/siridb1.conf b/dbtest/siridb1.conf new file mode 100644 index 00000000..83bd178e --- /dev/null +++ b/dbtest/siridb1.conf @@ -0,0 +1,85 @@ +# Welcome to the SiriDB configuration file + +[siridb] +# +# SiriDB will use this address:port for it's back-end connections. +# This must be an address that other servers can use to connect to. +# For example IPv4, IPv6 or a fqdn are all possible. When using IPv6 be sure +# to wrap the ip address with square brackets. For example [::1]:9010 +# The default value is %HOSTNAME:9010. The variable %HOSTNAME will be translate +# to the systems host name. +# +server_name = %HOSTNAME:9011 + +# +# Listen for SiriDB-server connections only on localhost. +# Use value 0.0.0.0 (or :: for IPv6) to bind to all interfaces. +# +bind_server_address = 0.0.0.0 + +# +# SiriDB will listen for client connections on this port number. +# +listen_client_port = 9001 + +# +# Listen for client connections only on localhost. +# Use value 0.0.0.0 (or :: for IPv6) to bind to all interfaces. +# +bind_client_address = 0.0.0.0 + +# +# When ip_support is set to ALL, SiriDB will listen and connect to both IPv4 +# and IPv6 addresses. +# Valid options are ALL, IPV4ONLY and IPV6ONLY. +# +ip_support = ALL + +# +# SiriDB will load databases from, and create databases in this location. +# +default_db_path = ./dbpath1 + +# +# SiriDB will run an optimize task each X seconds. A value of 0 (zero) disables +# optimizing. +# +optimize_interval = 3600 + +# +# SiriDB uses a heart-beat interval to keep connections with other servers +# online. +# +heartbeat_interval = 30 + +# +# SiriDB can run fsync on the buffer file on an interval in milliseconds. +# This value is set to 0 by default which tells SiriDB to run fsync after +# each insert request. When having many insert requests per second, it can be +# useful to use an interval like 500 milliseconds. +# +#buffer_sync_interval = 500 +buffer_sync_interval = 500 + +# +# SiriDB will not open more shard files than max_open_files. Note that the +# total number of open files can be sligtly higher since SiriDB also needs +# a few other files to write to. +# +max_open_files = 32768 + +# +# Use shard compression for storing data points. +# Set value 0 to disable shard compression. +# +enable_shard_compression = 1 + +# +# Enable named pipe support for client connections. +# +enable_pipe_support = 0 + +# +# SiriDB will bind the client named pipe in this location. +# +pipe_client_name = siridb_client.sock diff --git a/itest/run_all.py b/itest/run_all.py index 344c1d9b..81a941be 100644 --- a/itest/run_all.py +++ b/itest/run_all.py @@ -8,6 +8,7 @@ from test_list import TestList from test_insert import TestInsert from test_pool import TestPool from test_select import TestSelect +from test_select_ns import TestSelectNano from test_series import TestSeries from test_server import TestServer from test_user import TestUser @@ -26,6 +27,7 @@ if __name__ == '__main__': run_test(TestInsert()) run_test(TestPool()) run_test(TestSelect()) + run_test(TestSelectNano()) run_test(TestSeries()) run_test(TestServer()) run_test(TestUser()) diff --git a/itest/test_select.py b/itest/test_select.py index d2070b88..5c4afa13 100644 --- a/itest/test_select.py +++ b/itest/test_select.py @@ -21,16 +21,24 @@ from testing import TestBase from testing import UserAuthError from testing import parse_args - +LENPOINTS = 70 DATA = { - 'series float': [ + 'series-001 float': [ [1471254705, 1.5], [1471254707, -3.5], [1471254710, -7.3]], - 'series integer': [ + 'series-001 integer': [ [1471254705, 5], [1471254708, -3], [1471254710, -7]], + 'series-002 float': [ + [1471254705, 3.5], + [1471254707, -2.5], + [1471254710, -8.3]], + 'series-002 integer': [ + [1471254705, 4], + [1471254708, -1], + [1471254710, -8]], 'aggr': [ [1447249033, 531], [1447249337, 534], [1447249633, 535], [1447249937, 531], @@ -94,50 +102,63 @@ class TestSelect(TestBase): self.assertEqual( await self.client0.insert(DATA), - {'success_msg': 'Successfully inserted 64 point(s).'}) + {'success_msg': 'Successfully inserted {} point(s).'.format( + LENPOINTS)}) self.assertEqual( await self.client0.query( - 'select difference() from "series integer"'), - {'series integer': [[1471254708, -8], [1471254710, -4]]}) + 'select difference() from "series-001 integer"'), + {'series-001 integer': [[1471254708, -8], [1471254710, -4]]}) self.assertEqual( await self.client0.query( - 'select difference() => difference() from "series integer"'), - {'series integer': [[1471254710, 4]]}) + 'select difference() => difference() ' + 'from "series-001 integer"'), + {'series-001 integer': [[1471254710, 4]]}) self.assertEqual( await self.client0.query( 'select difference() => difference() => difference() ' - 'from "series integer"'), - {'series integer': []}) + 'from "series-001 integer"'), + {'series-001 integer': []}) now = int(time.time()) self.assertEqual( await self.client0.query( - 'select difference({}) from "series integer"'.format(now)), - {'series integer': [[now, -12]]}) + 'select difference({}) from "series-001 integer"'.format(now)), + {'series-001 integer': [[now, -12]]}) now = int(time.time()) self.assertEqual( await self.client0.query( - 'select difference({}) from "series integer"'.format(now)), - {'series integer': [[now, -12]]}) + 'select difference({}) from "series-001 integer"'.format(now)), + {'series-001 integer': [[now, -12]]}) self.assertEqual( await self.client0.query( - 'select * from /series.*/ ' + 'select * from /series-001.*/ ' 'merge as "median_low" using median_low({})' .format(now)), {'median_low': [[now, -3.5]]}) self.assertEqual( await self.client0.query( - 'select * from /series.*/ ' + 'select * from /series-001.*/ ' 'merge as "median_high" using median_high({})' .format(now)), {'median_high': [[now, -3.0]]}) + self.assertEqual( + await self.client0.query( + 'select * from /series.*/ ' + 'merge as "max" using max(1s)'), + {'max': [ + [1471254705, 5.0], + [1471254707, -2.5], + [1471254708, -1.0], + [1471254710, -7.0] + ]}) + # Test all aggregation methods self.assertEqual( @@ -248,8 +269,8 @@ class TestSelect(TestBase): self.assertEqual( await self.client0.query( - 'select limit(2, max) from "series float"'), - {'series float': [[1471254707, 1.5], [1471254713, -7.3]]}) + 'select limit(2, max) from "series-001 float"'), + {'series-001 float': [[1471254707, 1.5], [1471254713, -7.3]]}) self.assertAlmostEqual( await self.client0.query( @@ -425,7 +446,7 @@ class TestSelect(TestBase): await self.client0.query( 'select min(2h) prefix "min-", max(1h) prefix "max-" ' 'from /.*/ where type == integer and name != "filter" ' - 'and name != "one"' + 'and name != "one" and name != "series-002 integer" ' 'merge as "int_min_max" using median_low(1) => difference()'), { 'max-int_min_max': [ diff --git a/itest/test_select_ns.py b/itest/test_select_ns.py new file mode 100644 index 00000000..9878212e --- /dev/null +++ b/itest/test_select_ns.py @@ -0,0 +1,615 @@ +import asyncio +import functools +import random +import time +import math +import re +from testing import Client +from testing import default_test_setup +from testing import gen_data +from testing import gen_points +from testing import gen_series +from testing import InsertError +from testing import PoolError +from testing import QueryError +from testing import run_test +from testing import Series +from testing import Server +from testing import ServerError +from testing import SiriDB +from testing import TestBase +from testing import UserAuthError +from testing import parse_args + +LENPOINTS = 70 +DATA = { + 'series-001 float': [ + [1471254705000000005, 1.5], + [1471254705000000007, -3.5], + [1471254705000000010, -7.3]], + 'series-001 integer': [ + [1471254705000000005, 5], + [1471254705000000008, -3], + [1471254705000000010, -7]], + 'series-002 float': [ + [1471254705000000005, 3.5], + [1471254705000000007, -2.5], + [1471254705000000010, -8.3]], + 'series-002 integer': [ + [1471254705000000005, 4], + [1471254705000000008, -1], + [1471254705000000010, -8]], + 'aggr': [ + [1447249049033000000, 531], [1447249049337000000, 534], + [1447249049633000000, 535], [1447249049937000000, 531], + [1447249050249000000, 532], [1447249050549000000, 537], + [1447249050868000000, 530], [1447249051168000000, 520], + [1447249051449000000, 54], [1447249051749000000, 54], + [1447249052049000000, 513], [1447249052349000000, 537], + [1447249052649000000, 528], [1447249052968000000, 531], + [1447249053244000000, 533], [1447249053549000000, 538], + [1447249053849000000, 534], [1447249054149000000, 532], + [1447249054449000000, 533], [1447249054748000000, 537]], + + 'huge': [ + [1471254705000000005, 9223372036854775807], + [1471254705000000006, 9223372036854775806], + [1471254705000000007, 9223372036854775805], + [1471254705000000008, 9223372036854775804]], + 'equal ts': [ + [1471254705000000005, 0], [1471254705000000005, 1], + [1471254705000000005, 1], [1471254705000000007, 0], + [1471254705000000007, 1], [1471254705000000007, 0], + ], + 'variance': [ + [1471254705000000005, 2.75], [1471254705000000006, 1.75], + [1471254705000000007, 1.25], [1471254705000000008, 0.25], + [1471254705000000009, 0.5], [1471254705000000010, 1.25], + [1471254705000000011, 3.5] + ], + 'pvariance': [ + [1471254705000000005, 0.0], [1471254705000000006, 0.25], + [1471254705000000007, 0.25], [1471254705000000008, 1.25], + [1471254705000000009, 1.5], [1471254705000000010, 1.75], + [1471254705000000011, 2.75], [1471254705000000012, 3.25] + ], + 'filter': [ + [1471254705000000005, 5], + [1471254705000000010, -3], + [1471254705000000015, -7], + [1471254705000000020, 7] + ], + 'one': [ + [1471254705000000010, 1] + ], + 'log': [ + [1471254705000000010, 'log line one'], + [1471254705000000012, 'log line two'], + [1471254705000000014, 'another line (three)'], + [1471254705000000016, 'and yet one more'], + ], + 'special': [ + [1471254705000000005, 0.1], + [1471254705000000006, math.nan], + [1471254705000000007, math.inf], + [1471254705000000008, -math.inf], + ] +} + + +TIME_PRECISION = 'ns' + + +class TestSelectNano(TestBase): + title = 'Test select and aggregate functions' + + GEN_POINTS = functools.partial( + gen_points, n=1, time_precision=TIME_PRECISION) + + @default_test_setup(1, time_precision=TIME_PRECISION) + async def run(self): + await self.client0.connect() + + self.assertEqual( + await self.client0.insert(DATA), + {'success_msg': 'Successfully inserted {} point(s).'.format( + LENPOINTS)}) + + self.assertEqual( + await self.client0.query( + 'select difference() from "series-001 integer"'), + {'series-001 integer': [ + [1471254705000000008, -8], + [1471254705000000010, -4] + ]}) + + self.assertEqual( + await self.client0.query( + 'select difference() => difference() ' + 'from "series-001 integer"'), + {'series-001 integer': [[1471254705000000010, 4]]}) + + self.assertEqual( + await self.client0.query( + 'select difference() => difference() => difference() ' + 'from "series-001 integer"'), + {'series-001 integer': []}) + + now = int(time.time()*1000000000) + self.assertEqual( + await self.client0.query( + 'select difference({}) from "series-001 integer"'.format(now)), + {'series-001 integer': [[now, -12]]}) + + now = int(time.time()*1000000000) + self.assertEqual( + await self.client0.query( + 'select difference({}) from "series-001 integer"'.format(now)), + {'series-001 integer': [[now, -12]]}) + + self.assertEqual( + await self.client0.query( + 'select * from /series-001.*/ ' + 'merge as "median_low" using median_low({})' + .format(now)), + {'median_low': [[now, -3.5]]}) + + self.assertEqual( + await self.client0.query( + 'select * from /series-001.*/ ' + 'merge as "median_high" using median_high({})' + .format(now)), + {'median_high': [[now, -3.0]]}) + + self.assertEqual( + await self.client0.query( + 'select max(1) from /series.*/ ' + 'merge as "max" using max(1)'), + {'max': [ + [1471254705000000005, 5.0], + [1471254705000000007, -2.5], + [1471254705000000008, -1.0], + [1471254705000000010, -7.0] + ]}) + + # Test all aggregation methods + + self.assertEqual( + await self.client0.query('select sum(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 2131], + [1447249051000000000, 1599], + [1447249052000000000, 628], + [1447249053000000000, 2109], + [1447249054000000000, 1605], + [1447249055000000000, 1602] + ]}) + + self.assertEqual( + await self.client0.query('select count(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 4], + [1447249051000000000, 3], + [1447249052000000000, 3], + [1447249053000000000, 4], + [1447249054000000000, 3], + [1447249055000000000, 3] + ]}) + + self.assertEqual( + await self.client0.query('select mean(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 532.75], + [1447249051000000000, 533.0], + [1447249052000000000, 209.3333333333333333334], + [1447249053000000000, 527.25], + [1447249054000000000, 535.0], + [1447249055000000000, 534.0] + ]}) + + self.assertEqual( + await self.client0.query('select median(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 532.5], + [1447249051000000000, 532.0], + [1447249052000000000, 54.0], + [1447249053000000000, 529.5], + [1447249054000000000, 534.0], + [1447249055000000000, 533.0] + ]}) + + self.assertEqual( + await self.client0.query('select median_low(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 531.0], + [1447249051000000000, 532.0], + [1447249052000000000, 54.0], + [1447249053000000000, 528.0], + [1447249054000000000, 534.0], + [1447249055000000000, 533.0] + ]}) + + self.assertEqual( + await self.client0.query('select median_high(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 534.0], + [1447249051000000000, 532.0], + [1447249052000000000, 54.0], + [1447249053000000000, 531.0], + [1447249054000000000, 534.0], + [1447249055000000000, 533.0] + ]}) + + self.assertEqual( + await self.client0.query('select min(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 531.0], + [1447249051000000000, 530.0], + [1447249052000000000, 54.0], + [1447249053000000000, 513.0], + [1447249054000000000, 533.0], + [1447249055000000000, 532.0] + ]}) + + self.assertEqual( + await self.client0.query('select max(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 535.0], + [1447249051000000000, 537.0], + [1447249052000000000, 520.0], + [1447249053000000000, 537.0], + [1447249054000000000, 538.0], + [1447249055000000000, 537.0] + ]}) + + self.assertAlmostEqual( + await self.client0.query('select variance(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 4.25], + [1447249051000000000, 13.0], + [1447249052000000000, 72385.3333333333333333333], + [1447249053000000000, 104.25], + [1447249054000000000, 7.0], + [1447249055000000000, 7.0] + ]}) + + self.assertAlmostEqual( + await self.client0.query('select pvariance(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 3.1875], + [1447249051000000000, 8.666666666666666667], + [1447249052000000000, 48256.8888888888888888887], + [1447249053000000000, 78.1875], + [1447249054000000000, 4.666666666666666667], + [1447249055000000000, 4.666666666666666667] + ]}) + + self.assertEqual( + await self.client0.query('select difference(1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 0], + [1447249051000000000, -2], + [1447249052000000000, -466], + [1447249053000000000, 18], + [1447249054000000000, 1], + [1447249055000000000, 5] + ]}) + + self.assertAlmostEqual( + await self.client0.query('select derivative(1, 1s) from "aggr"'), + {'aggr': [ + [1447249050000000000, 0.0], + [1447249051000000000, -0.000000002], + [1447249052000000000, -0.000000466], + [1447249053000000000, 0.000000018], + [1447249054000000000, 0.000000001], + [1447249055000000000, 0.000000005] + ]}) + + self.assertEqual( + await self.client0.query('select filter(>534) from "aggr"'), + {'aggr': [ + [1447249049633000000, 535], + [1447249050549000000, 537], + [1447249052349000000, 537], + [1447249053549000000, 538], + [1447249054748000000, 537] + ]}) + + self.assertEqual( + await self.client0.query( + 'select filter(/l.*/) from * where type == string'), + {'log': [p for p in DATA['log'] if re.match('l.*', p[1])]}) + + self.assertEqual( + await self.client0.query( + 'select filter(==/l.*/) from * where type == string'), + {'log': [p for p in DATA['log'] if re.match('l.*', p[1])]}) + + self.assertEqual( + await self.client0.query( + 'select filter(!=/l.*/) from * where type == string'), + {'log': [p for p in DATA['log'] if not re.match('l.*', p[1])]}) + + self.assertEqual( + await self.client0.query('select limit(300, mean) from "aggr"'), + {'aggr': DATA['aggr']}) + + self.assertEqual( + await self.client0.query('select limit(1, sum) from "aggr"'), + {'aggr': [[1447249054748000000, 9674]]}) + + # The interval over which the mean is calculated is obtained + # by dividing the time period of the serie by the max_points + # and adding 1 ns to include the last point of the series. + self.assertEqual( + await self.client0.query('select limit(3, mean) from "aggr"'), + {'aggr': [ + [1447249050938000000, 532.8571428571429], + [1447249052843000001, 367.6666666666667], + [1447249054748000002, 534.0]]}) + + self.assertEqual( + await self.client0.query( + 'select limit(2, max) from "series-001 float"'), + {'series-001 float': [ + [1471254705000000007, 1.5], + [1471254705000000013, -7.3] + ]}) + + self.assertAlmostEqual( + await self.client0.query( + 'select variance(1471254705000000012) from "variance"'), + {'variance': [[1471254705000000012, 1.3720238095238095]]}) + + self.assertAlmostEqual( + await self.client0.query( + 'select pvariance(1471254705000000015) from "pvariance"'), + {'pvariance': [[1471254705000000015, 1.25]]}) + + self.assertEqual( + await self.client0.query('select * from "one"'), + {'one': [[1471254705000000010, 1]]}) + + self.assertEqual( + await self.client0.query('select * from "log"'), + {'log': DATA['log']}) + + self.assertEqual( + await self.client0.query( + 'select filter(~"log") => filter(!~"one") from "log"'), + {'log': [DATA['log'][1]]}) + + self.assertEqual( + await self.client0.query( + 'select filter(!=nan) from "special"'), + {'special': [p for p in DATA['special'] if not math.isnan(p[1])]}) + + self.assertAlmostEqual( + await self.client0.query( + 'select filter(==nan) from "special"'), + {'special': [p for p in DATA['special'] if math.isnan(p[1])]}) + + self.assertAlmostEqual( + await self.client0.query( + 'select filter(>=nan) from "special"'), + {'special': [p for p in DATA['special'] if math.isnan(p[1])]}) + + self.assertAlmostEqual( + await self.client0.query( + 'select filter(<=nan) from "special"'), + {'special': [p for p in DATA['special'] if math.isnan(p[1])]}) + + self.assertEqual( + await self.client0.query( + 'select filter(==inf) from "special"'), + {'special': [p for p in DATA['special'] if p[1] == math.inf]}) + + self.assertAlmostEqual( + await self.client0.query( + 'select filter(inf) from "special"'), + {'special': []}) + + self.assertEqual( + await self.client0.query( + 'select filter(==-inf) from "special"'), + {'special': [p for p in DATA['special'] if p[1] == -math.inf]}) + + self.assertAlmostEqual( + await self.client0.query( + 'select filter(>-inf) from "special"'), + {'special': [p for p in DATA['special'] if p[1] > -math.inf]}) + + self.assertAlmostEqual( + await self.client0.query( + 'select filter(<-inf) from "special"'), + {'special': []}) + + self.assertEqual( + await self.client0.query( + 'select filter(~"one") prefix "1-", ' + 'filter(~"two") prefix "2-" from "log"'), + { + '1-log': [ + [1471254705000000010, 'log line one'], + [1471254705000000016, 'and yet one more']], + '2-log': [[1471254705000000012, 'log line two']] + }) + + self.assertEqual( + await self.client0.query('select difference() from "one"'), + {'one': []}) + + with self.assertRaisesRegex( + QueryError, + 'Regular expressions can only be used with.*'): + await self.client0.query('select filter(~//) from "log"') + + with self.assertRaisesRegex( + QueryError, + 'Cannot use a string filter on number type.'): + await self.client0.query('select filter(//) from "aggr"') + + with self.assertRaisesRegex( + QueryError, + 'Cannot use mean\(\) on string type\.'): + await self.client0.query('select mean(1w) from "log"') + + with self.assertRaisesRegex( + QueryError, + 'Group by time must be an integer value larger than zero\.'): + await self.client0.query('select mean(0) from "aggr"') + + with self.assertRaisesRegex( + QueryError, + 'Limit must be an integer value larger than zero\.'): + await self.client0.query('select limit(6 - 6, mean) from "aggr"') + + with self.assertRaisesRegex( + QueryError, + 'Cannot use a string filter on number type\.'): + await self.client0.query( + 'select * from "aggr" ' + 'merge as "t" using filter("0")') + + with self.assertRaisesRegex( + QueryError, + 'Cannot use difference\(\) on string type\.'): + await self.client0.query('select difference() from "log"') + + with self.assertRaisesRegex( + QueryError, + 'Cannot use derivative\(\) on string type\.'): + await self.client0.query('select derivative(6, 3) from "log"') + + with self.assertRaisesRegex( + QueryError, + 'Cannot use derivative\(\) on string type\.'): + await self.client0.query('select derivative() from "log"') + + with self.assertRaisesRegex( + QueryError, + 'Overflow detected while using sum\(\)\.'): + await self.client0.query('select sum(now) from "huge"') + + with self.assertRaisesRegex( + QueryError, + 'Max depth reached in \'where\' expression!'): + await self.client0.query( + 'select * from "aggr" where ((((((length > 1))))))') + + with self.assertRaisesRegex( + QueryError, + 'Cannot compile regular expression.*'): + await self.client0.query( + 'select * from /(bla/') + + with self.assertRaisesRegex( + QueryError, + 'Memory allocation error or maximum recursion depth reached.'): + await self.client0.query( + 'select * from "aggr" where length > {}'.format('(' * 500)) + + with self.assertRaisesRegex( + QueryError, + 'Query too long.'): + await self.client0.query('select * from "{}"'.format('a' * 65535)) + + with self.assertRaisesRegex( + QueryError, + 'Error while merging points. Make sure the destination ' + 'series name is valid.'): + await self.client0.query( + 'select * from "aggr", "huge" merge as ""') + + self.assertEqual( + await self.client0.query( + 'select min(2s) prefix "min-", max(1s) prefix "max-" ' + 'from /.*/ where type == integer and name != "filter" ' + 'and name != "one" and name != "series-002 integer" ' + 'merge as "int_min_max" using median_low(1) => difference()'), + { + 'max-int_min_max': [ + [1447249051000000000, 2], + [1447249052000000000, -17], + [1447249053000000000, 17], + [1447249054000000000, 1], + [1447249055000000000, -1], + [1471254706000000000, -532] + ], + 'min-int_min_max': [ + [1447249052000000000, -477], + [1447249054000000000, 459], + [1447249056000000000, 19], + [1471254706000000000, -532] + ]}) + + await self.client0.query('select derivative() from "equal ts"') + + self.assertEqual( + await self.client0.query('select first() from *'), + {k: [v[0]] for k, v in DATA.items()}) + + self.assertEqual( + await self.client0.query('select last() from *'), + {k: [v[-1]] for k, v in DATA.items()}) + + self.assertEqual( + await self.client0.query('select count() from *'), + {k: [[v[-1][0], len(v)]] for k, v in DATA.items()}) + + self.assertEqual( + await self.client0.query('select mean() from "aggr"'), + {'aggr': [[ + DATA['aggr'][-1][0], + sum([x[1] for x in DATA['aggr']]) / len(DATA['aggr'])]]}) + + self.assertAlmostEqual( + await self.client0.query('select stddev() from "aggr"'), + {'aggr': [[ + DATA['aggr'][-1][0], + 147.07108914792838]]}) + + self.assertAlmostEqual( + await self.client0.query('select stddev(1s) from "aggr"'), + {"aggr": [ + [1447249050000000000, 2.0615528128088333333], + [1447249051000000000, 3.6055512754639999999], + [1447249052000000000, 269.0452254423666666667], + [1447249053000000000, 10.2102889283311111111], + [1447249054000000000, 2.6457513110645999999], + [1447249055000000000, 2.6457513110645999999] + ]}) + + # test prefix, suffex + result = await self.client0.query( + 'select sum(1d) prefix "sum-" suffix "-sum", ' + 'min(1d) prefix "minimum-", ' + 'max(1d) suffix "-maximum" from "aggr"') + + self.assertIn('sum-aggr-sum', result) + self.assertIn('minimum-aggr', result) + self.assertIn('aggr-maximum', result) + + await self.client0.query('alter database set select_points_limit 10') + with self.assertRaisesRegex( + QueryError, + 'Query has reached the maximum number of selected points.*'): + await self.client0.query( + 'select * from /.*/') + await self.client0.query( + 'alter database set select_points_limit 1000000') + + self.client0.close() + + # return False + + +if __name__ == '__main__': + parse_args() + run_test(TestSelectNano()) diff --git a/src/siri/db/points.c b/src/siri/db/points.c index 682e6d32..b81a27fe 100644 --- a/src/siri/db/points.c +++ b/src/siri/db/points.c @@ -1482,7 +1482,6 @@ static void POINTS_merge_and_sort(vec_t * plist, siridb_points_t * points) } } } - /* size should be exactly zero */ assert (n == 0); @@ -1503,7 +1502,11 @@ static void POINTS_merge_and_sort(vec_t * plist, siridb_points_t * points) static inline int POINTS_compare(const void * a, const void * b) { - return (((siridb_point_t *) a)->ts - ((siridb_point_t *) b)->ts); + return (((siridb_point_t *) a)->ts < ((siridb_point_t *) b)->ts) + ? -1 + : (((siridb_point_t *) a)->ts > ((siridb_point_t *) b)->ts) + ? 1 + : 0; } /*