SpanCount::dropped()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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