Closed yegor256 closed 11 years ago
migrated from Trac, where originally posted by yegor256 on 22-Aug-2010 8:02am
Adrian, what do you think? Can you implement it in 2 hours? If yes, please go ahead.
migrated from Trac, where originally posted by yegor256 on 23-Aug-2010 4:44am
More extensive example:
<?php
class QosTest extends PhpRack_Test
{
public function testLatency()
{
$this->assert->qos->latency(
array(
'scenario' => array(
'http://www.example.com',
'/index',
'/user-profile/' . rand(1, 99),
),
'averageMs' => 500, // 500ms average per request
'peakMs' => 2000, // 2s maximum per request
),
);
}
}
migrated from Trac, where originally posted by yegor256 on 23-Aug-2010 4:47am
latency()
accepts one argument, which is either a string (URL of the web page to test), or an array with parameters (default values are in squared brackets):
"scenario"
- list of URLs which should be tested on every cycle, one by one"averageMs"
- maximum time allowed per request, as an average, in milliseconds ![500]"peakMs"
- peak amount of time per request, in milliseconds ![1500]"testsTotal"
- how many requests should be made ![50]migrated from Trac, where originally posted by netcoderpl on 24-Aug-2010 2:11pm
I have two questions
In "scenario"
first url is absolute, and next are relative. It will be always true? How we will determine correct host if first url is relative?
"testsTotal"
- It mean requests or cycles? Each url should be checked by default 50 times or our method should make totally 50 requests?
migrated from Trac, where originally posted by yegor256 on 26-Aug-2010 5:19am
Let's skip the relative URLs. All URLs should be absolute. If not, we will throw an exception.
testsTotal
means the total amount of requests made. testsTotal=50 means that we will make 50 HTTP requests in total. If there are two URLs, every one of them will receive 25 requests.
migrated from Trac, where originally posted by netcoderpl on 26-Aug-2010 3:52pm
In [652]:
#CommitTicketReference repository="" revision="652"
refs #72 - new branch created
migrated from Trac, where originally posted by netcoderpl on 26-Aug-2010 3:53pm
In [653]:
#CommitTicketReference repository="" revision="653"
refs #72 - implemented
migrated from Trac, where originally posted by netcoderpl on 26-Aug-2010 3:54pm
Please review.
migrated from Trac, where originally posted by yegor256 on 27-Aug-2010 8:25am
In [654]:
#CommitTicketReference repository="" revision="654"
refs #72 - implemented in branch and merged into trunk
migrated from Trac, where originally posted by yegor256 on 27-Aug-2010 8:26am
In [655]:
#CommitTicketReference repository="" revision="655"
refs #72 - phpcs fixes
migrated from Trac, where originally posted by yegor256 on 27-Aug-2010 8:35am
[wiki:Assertions@21] updated
migrated from Trac, where originally posted by yegor256 on 27-Aug-2010 8:35am
In [656]:
#CommitTicketReference repository="" revision="656"
closes #72 - branch closed
migrated from Trac, where originally posted by yegor256 on 27-Aug-2010 8:36am
many thanks!
migrated from Trac, where originally posted by yegor256 on 22-Aug-2010 8:01am
Would be nice to have latency test:
This way we can implement self-testable platforms.