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
89ce10f8
Commit
89ce10f8
authored
6 years ago
by
Tibo
Browse files
Options
Downloads
Patches
Plain Diff
Show RX and TX, speed / sec
parent
23a1dcd9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web/app/Sensor/Ifconfig.php
+23
-21
23 additions, 21 deletions
web/app/Sensor/Ifconfig.php
web/public/js/sensor.ifconfig.js
+1
-1
1 addition, 1 deletion
web/public/js/sensor.ifconfig.js
with
24 additions
and
22 deletions
web/app/Sensor/Ifconfig.php
+
23
−
21
View file @
89ce10f8
...
...
@@ -41,21 +41,37 @@ class Ifconfig extends AbstractSensor {
$current_value
=
[];
foreach
(
$interfaces
[
0
]
as
$interface
)
{
$iname
=
$interface
->
name
;
$dataset
[
$iname
]
=
[
"name"
=>
$iname
,
$dataset
[
$iname
.
"/TX"
]
=
[
"name"
=>
$iname
.
"/TX"
,
"points"
=>
[]
];
$current_value
[
$interface
->
name
]
=
$interface
->
rx
;
$dataset
[
$iname
.
"/TX"
]
=
[
"name"
=>
$iname
.
"/TX"
,
"points"
=>
[]
];
$current_value
[
$interface
->
name
]
=
$interface
;
}
for
(
$i
=
1
;
$i
<
count
(
$interfaces
);
$i
++
)
{
foreach
(
$interfaces
[
$i
]
as
$interface
)
{
$iname
=
$interface
->
name
;
$delta
=
$interface
->
rx
-
$current_value
[
$iname
];
$current_value
[
$iname
]
=
$interface
->
rx
;
$dataset
[
$iname
][
"points"
][]
=
new
Point
(
$previous_value
=
$current_value
[
$iname
];
$delta_time
=
$interface
->
time
-
$previous_value
->
time
;
// RX
$delta
=
$interface
->
rx
-
$previous_value
->
rx
;
$dataset
[
$iname
.
"/RX"
][
"points"
][]
=
new
Point
(
$interface
->
time
*
1000
,
$delta
);
$delta
/
$delta_time
);
// TX
$delta
=
$interface
->
tx
-
$previous_value
->
tx
;
$dataset
[
$iname
.
"/TX"
][
"points"
][]
=
new
Point
(
$interface
->
time
*
1000
,
$delta
/
$delta_time
);
// Keep current value for next record
$current_value
[
$iname
]
=
$interface
;
}
}
...
...
@@ -64,20 +80,6 @@ class Ifconfig extends AbstractSensor {
}
/*
public function cachedMemoryPoints() {
$records = $this->getLastRecords("ifconfig", 288);
$points = [];
foreach ($records as $record) {
$interfaces = $this->parseIfconfig($record->memory);
$points[] = new Point(
$record->time * 1000, $interface->cached / 1000);
}
return $points;
}*/
public
function
status
()
{
return
self
::
STATUS_OK
;
}
...
...
This diff is collapsed.
Click to expand it.
web/public/js/sensor.ifconfig.js
+
1
−
1
View file @
89ce10f8
...
...
@@ -26,7 +26,7 @@ window.monitorIfconfigChart = function(element) {
},
scaleLabel
:
{
display
:
true
,
labelString
:
'
[Bytes]
'
labelString
:
'
[Bytes
/ sec
]
'
}
}]
},
...
...
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