SpanCount   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 50
ccs 11
cts 11
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A dropped() 0 3 1
A __construct() 0 4 1
A jsonSerialize() 0 5 1
A started() 0 3 1
1
<?php
2
3
namespace ZoiloMora\ElasticAPM\Events\Transaction;
4
5
final class SpanCount implements \JsonSerializable
6
{
7
    /**
8
     * Number of correlated spans that are recorded.
9
     *
10
     * @var int
11
     */
12
    private $started;
13
14
    /**
15
     * Number of spans that have been dropped by the agent recording the transaction.
16
     *
17
     * @var int|null
18
     */
19
    private $dropped;
20
21
    /**
22
     * @param int $started
23
     * @param int|null $dropped
24
     */
25 15
    public function __construct($started, $dropped = null)
26
    {
27 15
        $this->started = $started;
28 15
        $this->dropped = $dropped;
29 15
    }
30
31
    /**
32
     * @return int
33
     */
34 1
    public function started()
35
    {
36 1
        return $this->started;
37
    }
38
39
    /**
40
     * @return int|null
41
     */
42 1
    public function dropped()
43
    {
44 1
        return $this->dropped;
45
    }
46
47
    /**
48
     * @return array
49
     */
50 2
    public function jsonSerialize()
51
    {
52
        return [
53 2
            'started' => $this->started,
54 2
            'dropped' => $this->dropped,
55 2
        ];
56
    }
57
}
58