Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111077573
MultimeterEvent.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Apr 29, 12:16
Size
1 KB
Mime Type
text/x-php
Expires
Thu, May 1, 12:16 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25876686
Attached To
rPH Phabricator
MultimeterEvent.php
View Options
<?php
final
class
MultimeterEvent
extends
MultimeterDAO
{
const
TYPE_STATIC_RESOURCE
=
0
;
protected
$eventType
;
protected
$eventLabelID
;
protected
$resourceCost
;
protected
$sampleRate
;
protected
$eventContextID
;
protected
$eventHostID
;
protected
$eventViewerID
;
protected
$epoch
;
protected
$requestKey
;
private
$eventLabel
;
public
function
setEventLabel
(
$event_label
)
{
$this
->
eventLabel
=
$event_label
;
return
$this
;
}
public
function
getEventLabel
()
{
return
$this
->
eventLabel
;
}
public
static
function
getEventTypeName
(
$type
)
{
switch
(
$type
)
{
case
self
::
TYPE_STATIC_RESOURCE
:
return
pht
(
'Static Resource'
);
}
return
pht
(
'Unknown ("%s")'
,
$type
);
}
public
static
function
formatResourceCost
(
PhabricatorUser
$viewer
,
$type
,
$cost
)
{
switch
(
$type
)
{
case
self
::
TYPE_STATIC_RESOURCE
:
return
pht
(
'%s Req'
,
new
PhutilNumber
(
$cost
));
}
return
pht
(
'%s Unit(s)'
,
new
PhutilNumber
(
$cost
));
}
protected
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_TIMESTAMPS
=>
false
,
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'eventType'
=>
'uint32'
,
'resourceCost'
=>
'sint64'
,
'sampleRate'
=>
'uint32'
,
'requestKey'
=>
'bytes12'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'key_request'
=>
array
(
'columns'
=>
array
(
'requestKey'
),
),
'key_type'
=>
array
(
'columns'
=>
array
(
'eventType'
,
'epoch'
),
),
),
)
+
parent
::
getConfiguration
();
}
}
Event Timeline
Log In to Comment