PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / trunk
Matomo Analytics – Powerful, Privacy-First Insights for WordPress vtrunk
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / core / CronArchive / Performance / Measurement.php
matomo / app / core / CronArchive / Performance Last commit date
Logger.php 1 year ago Measurement.php 2 years ago
Measurement.php
137 lines
1 <?php
2
3 /**
4 * Matomo - free/libre analytics platform
5 *
6 * @link https://matomo.org
7 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8 */
9 namespace Piwik\CronArchive\Performance;
10
11 class Measurement
12 {
13 /**
14 * @var string
15 */
16 private $category;
17 /**
18 * @var string
19 */
20 private $measuredName;
21 /**
22 * @var string
23 */
24 private $idSite;
25 /**
26 * @var string
27 */
28 private $dateRange;
29 /**
30 * @var string
31 */
32 private $periodType;
33 /**
34 * @var string
35 */
36 private $segment;
37 /**
38 * @var float
39 */
40 private $time;
41 /**
42 * @var string
43 */
44 private $memory;
45 /**
46 * @var string
47 */
48 private $peakMemory;
49 public function __construct($category, $name, $idSite, $dateRange, $periodType, $segment, $time, $memory, $peakMemory)
50 {
51 $this->category = $category;
52 $this->measuredName = $name;
53 $this->idSite = $idSite;
54 $this->dateRange = $dateRange;
55 $this->periodType = $periodType;
56 $this->segment = trim($segment);
57 $this->time = $time;
58 $this->memory = $memory;
59 $this->peakMemory = $peakMemory;
60 }
61 public function __toString()
62 {
63 $parts = [ucfirst($this->category) . ": {$this->measuredName}", "idSite: {$this->idSite}", "period: {$this->periodType} ({$this->dateRange})", "segment: " . (!empty($this->segment) ? $this->segment : 'none'), "duration: {$this->time}s", "memory leak: {$this->memory}", "peak memory usage: {$this->peakMemory}"];
64 return implode(', ', $parts);
65 }
66 /**
67 * @return string
68 */
69 public function getCategory()
70 {
71 return $this->category;
72 }
73 /**
74 * @param string $category
75 */
76 public function setCategory($category)
77 {
78 $this->category = $category;
79 }
80 /**
81 * @return string
82 */
83 public function getMeasuredName()
84 {
85 return $this->measuredName;
86 }
87 /**
88 * @param string $measuredName
89 */
90 public function setMeasuredName($measuredName)
91 {
92 $this->measuredName = $measuredName;
93 }
94 /**
95 * @return string
96 */
97 public function getIdSite()
98 {
99 return $this->idSite;
100 }
101 /**
102 * @param string $idSite
103 */
104 public function setIdSite($idSite)
105 {
106 $this->idSite = $idSite;
107 }
108 /**
109 * @return string
110 */
111 public function getDateRange()
112 {
113 return $this->dateRange;
114 }
115 /**
116 * @param string $dateRange
117 */
118 public function setDateRange($dateRange)
119 {
120 $this->dateRange = $dateRange;
121 }
122 /**
123 * @return string
124 */
125 public function getPeriodType()
126 {
127 return $this->periodType;
128 }
129 /**
130 * @param string $periodType
131 */
132 public function setPeriodType($periodType)
133 {
134 $this->periodType = $periodType;
135 }
136 }
137