new_stream.sim 1.8 KB
Newer Older
1
#system sh/stop_dnodes.sh
S
slguan 已提交
2

S
slguan 已提交
3

4 5 6 7
#system sh/deploy.sh -n dnode1 -i 1
#system sh/cfg.sh -n dnode1 -c walLevel -v 0
#system sh/cfg.sh -n dnode1 -c tableMetaKeepTimer -v 10
#system sh/exec.sh -n dnode1 -s start
S
slguan 已提交
8

9
#sleep 3000
S
slguan 已提交
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
sql connect
print ======================== dnode1 start

$dbPrefix = ns_db
$tbPrefix = ns_tb
$mtPrefix = ns_mt
$stPrefix = ns_st
$tbNum = 5
$rowNum = 200
$totalNum = 200

print =============== step1

$i = 0
$db = $dbPrefix
$mt = $mtPrefix
$st = $stPrefix

sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)

$i = 0
while $i < $tbNum
  $tb = $tbPrefix . $i
  sql create table $tb using $mt tags( $i )
  
  $x = 0
  $y = 0
  while $y < $rowNum
    $ms = $x . s
    sql insert into $tb values (now + $ms , $y , $y ) 
    $x = $x + 1
	$y = $y + 1
  endw 
 
  $i = $i + 1
endw 

sleep 100

print =============== step2

sql select count(*), count(tbcol), count(tbcol2) from $mt interval(10s)
print $data00 $data01 $data02 $data03

sql create table $st as select count(*), count(tbcol), count(tbcol2) from $mt interval(10s)

print =============== step3
59 60
print sleep 120 seconds
sleep 120000 
S
slguan 已提交
61 62 63 64 65

print =============== step4

sql select * from $st
print $st ==> $rows1 $data00 $data01 $data02 $data03
66
if $data03 >= 51 then
S
slguan 已提交
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
 return -1
endi

print =============== step5

$tbNum = 10
while $i < $tbNum
  $tb = $tbPrefix . $i
  sql create table $tb using $mt tags( $i )
  if $i == 0 then 
    sleep 2000
  endi
  
  $x = 0
  $y = 0
  while $y < $rowNum
    $ms = $x . s
    sql insert into $tb values (now + $ms , $y , $y ) 
    $x = $x + 1
	$y = $y + 1
  endw 
 
  $i = $i + 1
endw 

print =============== step6
93 94
print sleep 120 seconds
sleep 120000 
S
slguan 已提交
95 96 97 98 99 100 101 102 103 104 105 106 107

print =============== step7

sql select * from $st order by ts desc
print $st ==> $rows1 $data00 $data01 $data02 $data03
if $data03 <= 51 then
 return -1
endi