Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

loop back to a previous request (TSUN-62)

SVN Revision: 828
  • Loading branch information...
commit cd0de81502c69e74383c9ba4cb4ec7dacb528805 1 parent c3af9b0
@nniclausse nniclausse authored
View
1  include/ts_profile.hrl
@@ -35,6 +35,7 @@
do = continue, %(continue | loop | stop)
sleep_loop, % in seconds
max_loop,
+ loop_back,
max_restart
}).
View
6 src/tsung/ts_search.erl
@@ -184,7 +184,7 @@ setcount(#match{do=restart, max_restart=MaxRestart}, {_Count, MaxC}, Stats)->
ts_mon:add([{count, match_restart} | Stats]),
MaxC
end;
-setcount(#match{do=loop,max_loop=MaxLoop,sleep_loop=Sleep},{Count,_MaxC},Stats)->
+setcount(#match{do=loop,loop_back=Back,max_loop=MaxLoop,sleep_loop=Sleep},{Count,_MaxC},Stats)->
CurLoop = get(loop_count),
?LOGF("Loop on (no)match ~p~n",[CurLoop], ?INFO),
ts_mon:add([{count, match_loop} | Stats]),
@@ -192,7 +192,7 @@ setcount(#match{do=loop,max_loop=MaxLoop,sleep_loop=Sleep},{Count,_MaxC},Stats)-
undefined ->
put(loop_count,1),
timer:sleep(Sleep),
- Count +1 ;
+ Count +1 + Back ;
Val when Val >= MaxLoop ->
?LOG("Max Loop reached, abort loop on request! ~n", ?WARN),
put(loop_count, 0),
@@ -200,7 +200,7 @@ setcount(#match{do=loop,max_loop=MaxLoop,sleep_loop=Sleep},{Count,_MaxC},Stats)-
Val ->
put(loop_count, Val +1),
timer:sleep(Sleep),
- Count + 1
+ Count + 1 + Back
end;
setcount(#match{do=abort}, _, Stats) ->
ts_mon:add([{count, match_stop} | Stats]),
View
4 src/tsung_controller/ts_config.erl
@@ -340,12 +340,12 @@ parse(Element=#xmlElement{name=match,attributes=Attrs},
Do = getAttr(atom, Attrs, do, continue),
When = getAttr(atom, Attrs, 'when', match),
MaxLoop = getAttr(integer, Attrs, max_loop, 20),
+ LoopBack = getAttr(integer, Attrs, loop_back, 0),
MaxRestart = getAttr(integer, Attrs, max_restart, 3),
SleepLoop = getAttr(integer, Attrs, sleep_loop, 5),
ValRaw = getText(Element#xmlElement.content),
RegExp = ts_utils:clean_str(ValRaw),
- NewMatch = #match{regexp=RegExp, do=Do,'when'=When,sleep_loop=SleepLoop * 1000,
- max_restart=MaxRestart, max_loop=MaxLoop },
+ NewMatch = #match{regexp=RegExp, do=Do,'when'=When,sleep_loop=SleepLoop * 1000, loop_back=LoopBack, max_restart=MaxRestart, max_loop=MaxLoop },
lists:foldl(fun parse/2,
Conf#config{ match=lists:append(Match, [NewMatch]) },
View
1  tsung-1.0.dtd
@@ -93,6 +93,7 @@
<!ATTLIST match
do (continue|loop|abort|restart) "continue"
when (match|nomatch) "match"
+ loop_back NMTOKEN "0"
max_loop NMTOKEN "20"
max_restart NMTOKEN "3"
sleep_loop NMTOKEN "5"
Please sign in to comment.
Something went wrong with that request. Please try again.