1 | <?php |
||
14 | class JobOriginStatistic implements NodeStatistic |
||
15 | { |
||
16 | /** |
||
17 | * Node Ids |
||
18 | * |
||
19 | * @var \DateTime[] |
||
20 | */ |
||
21 | private $lastReceived; |
||
22 | |||
23 | /** |
||
24 | * 2-dimensional array storing rates for (queue, nodeId) pairs |
||
25 | * @var string[] |
||
26 | */ |
||
27 | private $stats; |
||
28 | |||
29 | /** |
||
30 | * @var LoggerInterface |
||
31 | */ |
||
32 | private $log; |
||
33 | |||
34 | /** |
||
35 | * @var float |
||
36 | */ |
||
37 | private $alpha; |
||
38 | |||
39 | |||
40 | /** |
||
41 | * @param float $alpha Sensitivity factor. |
||
42 | * @param LoggerInterface $log |
||
|
|||
43 | */ |
||
44 | function __construct($alpha = 0.9, LoggerInterface $log = null) |
||
57 | |||
58 | |||
59 | /** |
||
60 | * Update jobs by node/sec rt-statistic. |
||
61 | * |
||
62 | * @param Job $job |
||
63 | * |
||
64 | * @param \DateTime $receivedAt |
||
65 | * |
||
66 | * @return float messages/sec from the given node |
||
67 | */ |
||
68 | public function update(Job $job, \DateTime $receivedAt = null) |
||
110 | |||
111 | |||
112 | /** |
||
113 | * Return an ordered list of nodes. |
||
114 | * |
||
115 | * The list is ordered descending by the frequency of Jobs. |
||
116 | * |
||
117 | * @return float[] |
||
118 | */ |
||
119 | public function nodes($queue) |
||
124 | |||
125 | |||
126 | /** |
||
127 | * Return information on a specific (queue, node). |
||
128 | * |
||
129 | * If the queue and/or node is not known, no messages have been retrieved from it, so 0. will be returned. |
||
130 | * |
||
131 | * @param string $queue |
||
132 | * @param string $nodeId |
||
133 | * |
||
134 | * @return float msg rate (per sec) |
||
135 | */ |
||
136 | public function node($queue, $nodeId) |
||
140 | } |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.