mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-27 09:42:11 +00:00
inEventSample: Avoid invalid character warning from sampling code, hash into hex
Bug: T314896 Change-Id: I377bbe54686fdb9d765543320aef14a99ee2cd7f
This commit is contained in:
parent
68b4eae84e
commit
0e3f7c44b2
|
@ -97,8 +97,12 @@ class Hooks implements
|
|||
// Sample 6.25%
|
||||
$samplingRate = $this->config->has( 'WMESchemaEditAttemptStepSamplingRate' ) ?
|
||||
$this->config->get( 'WMESchemaEditAttemptStepSamplingRate' ) : 0.0625;
|
||||
|
||||
// (T314896) Convert whatever we've been given to a string of hex, as that's what EL needs
|
||||
$hexValue = hash( 'md5', $sessionId, false );
|
||||
|
||||
$inSample = EventLogging::sessionInSample(
|
||||
(int)( 1 / $samplingRate ), $sessionId
|
||||
(int)( 1 / $samplingRate ), $hexValue
|
||||
);
|
||||
return $inSample;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue