mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-07-13 03:24:29 +02:00
publish copy updates
This commit is contained in:
parent
4548f7c5c1
commit
8a3419b536
22 changed files with 63 additions and 48 deletions
|
@ -3,7 +3,7 @@
|
|||
# script to report page load time of google.com
|
||||
|
||||
# get the current time
|
||||
:local CurrentTime [/system/clock get time];
|
||||
:local CurrentTime [/system clock get time];
|
||||
|
||||
# calculate the time in 1 minute
|
||||
:local EndTime ($CurrentTime + 00:01:00);
|
||||
|
@ -11,24 +11,28 @@
|
|||
# define a target web site
|
||||
:local WebSite "www.google.com";
|
||||
|
||||
# run a while loop until one minute interval expired
|
||||
# run a while loop until one minute interval has expired
|
||||
:while ( [/system/clock get time] < $EndTime ) do={
|
||||
|
||||
:put "Getting web page from $WebSite";
|
||||
|
||||
# fetch a page from web site
|
||||
:local FetchResult [/tool fetch url=("https://$WebSite") mode=https \
|
||||
http-method=get as-value keep-result=no];
|
||||
:local FetchResult;
|
||||
:local TimeTaken [:time {
|
||||
:set FetchResult [/tool fetch url=("https://$WebSite") \
|
||||
mode=https http-method=get as-value keep-result=no];
|
||||
}];
|
||||
|
||||
if ($FetchResult->"status" = "finished") do={
|
||||
# print out how long page retrieval took (if successful)
|
||||
:local FetchDuration ($FetchResult->"duration");
|
||||
:put "Web page fetch time: $FetchDuration secs";
|
||||
:put "Web page fetch time: $TimeTaken secs";
|
||||
} else={
|
||||
# print failure message if fetch failed
|
||||
:put "Web page fetch failed";
|
||||
}
|
||||
|
||||
# pause for 5 seconds
|
||||
:delay 5;
|
||||
|
||||
}
|
||||
:put "One minute period has ended!"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue