Skip to content

Commit

Permalink
merged stomp changes from trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
emil committed May 8, 2009
1 parent b13b222 commit b90601f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions wikia/releases/200905.1/includes/GlobalFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -861,17 +861,20 @@ function wfReportTime() {
if( $wgShowHostnames) header( sprintf( "X-Served-By-Backend: %s", wfHostname() ) );

// WIKIA: send a message to the MQ
global $wgReportTimeToStomp;
if( $wgReportTimeToStomp ) {
global $wgReportTimeViaStomp;
if( $wgReportTimeViaStomp ) {
global $wgStompServer, $wgStompUser, $wgStompPassword;
$stomp = new Stomp( $wgStompServer );
$stomp->connect( $wgStompUser, $wgStompPassword );
$stomp->sync = false;
$stomp->send( 'wikia.apache.service_time.'.wfHostname(),
Wikia::json_encode( array( 'real' => $elapsed, 'cpu' => $elapsedcpu ) ),
array( 'exchange' => 'amq.topic', 'bytes_message' => 1 ),
false
);
$stomp->disconnect();
Wikia::json_encode( array(
'real' => $elapsed,
'cpu' => $elapsedcpu,
'url' => 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
) ),
array( 'exchange' => 'amq.topic', 'bytes_message' => 1 )
);
}

return $wgShowHostnames
Expand Down

0 comments on commit b90601f

Please sign in to comment.