Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106027763
PhutilHighIntensityIntervalDaemon.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Mar 21, 16:15
Size
488 B
Mime Type
text/x-php
Expires
Sun, Mar 23, 16:15 (1 d, 16 h)
Engine
blob
Format
Raw Data
Handle
25099825
Attached To
rPHU libphutil
PhutilHighIntensityIntervalDaemon.php
View Options
<?php
/**
* Daemon which is very busy every other minute. This will cause it to
* autoscale up and down.
*
*/
final
class
PhutilHighIntensityIntervalDaemon
extends
PhutilTortureTestDaemon
{
protected
function
run
()
{
while
(!
$this
->
shouldExit
())
{
$m
=
(
int
)
date
(
'i'
);
if
(
$m
%
2
)
{
$this
->
willBeginWork
();
$this
->
log
(
'Busy.'
);
}
else
{
$this
->
willBeginIdle
();
$this
->
log
(
'Idle.'
);
}
$this
->
sleep
(
1
);
}
}
}
Event Timeline
Log In to Comment