Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
monitoring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
monitoring
Commits
ba978a13
Commit
ba978a13
authored
4 years ago
by
Tibo
Browse files
Options
Downloads
Patches
Plain Diff
remove commented code
parent
9692faa5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/Sensor/CPUtemperature.php
+3
-24
3 additions, 24 deletions
app/Sensor/CPUtemperature.php
with
3 additions
and
24 deletions
app/Sensor/CPUtemperature.php
+
3
−
24
View file @
ba978a13
...
...
@@ -12,28 +12,7 @@ class CPUtemperature extends \App\AbstractSensor
const
REGEXP
=
"/^(Core \d+):\s+\+(\d+\.\d+)/m"
;
const
REGEXPCPU
=
"/^(Package id)+\s+(\d):\s+\+(\d+\.\d+)°C\s+\(high\s=\s\+\d+\.\d°C,\scrit\s=\s\+(\d+\.\d+)°C\)/m"
;
/*
public function report()
{
$record = $this->getLastRecord("cpu-temperature");
if ($record == null) {
return "<p>No data available...</p>"
. "<p>Maybe <code>sensors</code> is not installed.</p>"
. "<p>You can install it with <code>sudo apt install lm-sensors</code></p>";
}
$temperatures = self::parse($record['cpu-temperature']);
$CPUS=self::parseCPU($record['cpu-temperature']);
$return = "<table class='table table-sm'>";
$return .= "<tr><th>Name</th><th>Temperature (°C)</th></tr>";
foreach ($temperatures as $temperature) {
$return .= "<tr><td>" . $temperature->name . "</td><td>"
. $temperature->value . "</td></tr>";
}
$return .= "</table>";
return $return;
}
*/
public
function
report
()
{
$record
=
$this
->
getLastRecord
(
"cpu-temperature"
);
...
...
@@ -59,7 +38,7 @@ class CPUtemperature extends \App\AbstractSensor
$return
.
=
"</table>"
;
return
$return
;
}
public
function
status
()
{
$record
=
$this
->
getLastRecord
(
"cpu-temperature"
);
...
...
@@ -86,7 +65,7 @@ class CPUtemperature extends \App\AbstractSensor
return
max
(
$all_status
);
}
public
static
function
parse
(
string
$string
)
//cores only
{
$values
=
array
();
...
...
@@ -101,7 +80,7 @@ class CPUtemperature extends \App\AbstractSensor
}
return
$temperatures
;
}
public
static
function
parseCPU
(
string
$string
)
//cpus only
{
$values
=
array
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment