Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2750389
MetricsClientFactory.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
MetricsClientFactory.php
View Options
<?php
namespace
MediaWiki\Extension\EventLogging\MetricsPlatform
;
use
MediaWiki\Context\IContextSource
;
use
MediaWiki\Extension\EventLogging\EventSubmitter\EventSubmitter
;
use
MediaWiki\Extension\EventLogging\MetricsPlatform\EventSubmitter
as
MetricsPlatformEventSubmitter
;
use
Psr\Log\LoggerInterface
;
use
Wikimedia\MetricsPlatform\MetricsClient
;
use
Wikimedia\MetricsPlatform\StreamConfig\StreamConfigFactory
;
class
MetricsClientFactory
{
/** @var ContextAttributesFactory */
private
$contextAttributesFactory
;
/** @var EventSubmitter */
private
$eventSubmitter
;
/** @var array|bool */
private
$streamConfigs
;
/** @var LoggerInterface */
private
$logger
;
public
function
__construct
(
ContextAttributesFactory
$contextAttributesFactory
,
EventSubmitter
$eventSubmitter
,
$streamConfigs
,
LoggerInterface
$logger
)
{
$this
->
contextAttributesFactory
=
$contextAttributesFactory
;
$this
->
eventSubmitter
=
$eventSubmitter
;
$this
->
streamConfigs
=
$streamConfigs
;
$this
->
logger
=
$logger
;
}
public
function
newMetricsClient
(
IContextSource
$requestContext
):
MetricsClient
{
$eventSubmitter
=
new
MetricsPlatformEventSubmitter
(
$this
->
eventSubmitter
);
$integration
=
new
Integration
(
$this
->
contextAttributesFactory
,
$requestContext
);
// TODO: EventStreamConfig (and EventLogging to some extent) and the PHP Metrics Platform
// Client have representations of stream configs. Extract a single representation into a
// library.
$streamConfigs
=
new
StreamConfigFactory
(
$this
->
streamConfigs
);
return
new
MetricsClient
(
$eventSubmitter
,
$integration
,
$streamConfigs
,
$this
->
logger
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jul 3, 16:24 (5 h, 13 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
5d/70/c5c886cb53685bebbe76e2539ee6
Default Alt Text
MetricsClientFactory.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment