dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SpecialSearch: Get title from one we already have on hand in the context
[lhc/web/wiklou.git]
/
includes
/
StatCounter.php
diff --git
a/includes/StatCounter.php
b/includes/StatCounter.php
index
374d5ca
..
a429c36
100644
(file)
--- a/
includes/StatCounter.php
+++ b/
includes/StatCounter.php
@@
-36,7
+36,7
@@
* @ingroup StatCounter
*/
class StatCounter {
* @ingroup StatCounter
*/
class StatCounter {
- /** @var
A
rray */
+ /** @var
a
rray */
protected $deltas = array(); // (key => count)
protected function __construct() {}
protected $deltas = array(); // (key => count)
protected function __construct() {}
@@
-56,7
+56,7
@@
class StatCounter {
* Increment a key by delta $count
*
* @param string $key
* Increment a key by delta $count
*
* @param string $key
- * @param int
eger
$count
+ * @param int $count
* @return void
*/
public function incr( $key, $count = 1 ) {
* @return void
*/
public function incr( $key, $count = 1 ) {
@@
-91,20
+91,20
@@
class StatCounter {
* @return void
*/
protected function sendDeltasUDP( array $deltas ) {
* @return void
*/
protected function sendDeltasUDP( array $deltas ) {
- global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgAggregateStatsID;
+ global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgAggregateStatsID,
+ $wgStatsFormatString;
$id = strlen( $wgAggregateStatsID ) ? $wgAggregateStatsID : wfWikiID();
$lines = array();
foreach ( $deltas as $key => $count ) {
$id = strlen( $wgAggregateStatsID ) ? $wgAggregateStatsID : wfWikiID();
$lines = array();
foreach ( $deltas as $key => $count ) {
- $lines[] =
"stats/{$id} - {$count} 1 1 1 1 {$key}\n"
;
+ $lines[] =
sprintf( $wgStatsFormatString, $id, $count, $key )
;
}
if ( count( $lines ) ) {
static $socket = null;
if ( !$socket ) {
$socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
}
if ( count( $lines ) ) {
static $socket = null;
if ( !$socket ) {
$socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
- array_unshift( $lines, "stats/{$id} - 1 1 1 1 1 -total\n" );
}
$packet = '';
$packets = array();
}
$packet = '';
$packets = array();