Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4084720
statsv.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
881 B
Referenced Files
None
Subscribers
None
statsv.js
View Options
/**
* @module instrumentation/statsv
* @private
*/
/**
* Gets whether Graphite logging (via [the statsv HTTP endpoint][0]) is enabled
* for the duration of the user's session. The bucketing rate is controlled by
* `wgPopupsStatsvSamplingRate`.
*
* [0]: https://wikitech.wikimedia.org/wiki/Graphite#statsv
*
* @param {mw.User} user The `mw.user` singleton instance
* @param {mw.Map} config The `mw.config` singleton instance
* @param {Experiments} experiments
* @return {boolean}
*/
export
function
isEnabled
(
user
,
config
,
experiments
)
{
const
bucketingRate
=
config
.
get
(
'wgPopupsStatsvSamplingRate'
,
0
);
if
(
bucketingRate
===
0
||
bucketingRate
===
1
)
{
// Avoid calling user.sessionId() if possible, since it sets a cookie
return
!!
bucketingRate
;
}
return
experiments
.
weightedBoolean
(
'ext.Popups.statsv'
,
bucketingRate
,
user
.
sessionId
()
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 18 2026, 07:51 (7 w, 2 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ab/da/64a13a0a9ac10674aa279f6f2e1f
Default Alt Text
statsv.js (881 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment