Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simmctic
agent
Commits
e8f9bf43
There was a problem fetching the pipeline summary.
Commit
e8f9bf43
authored
7 years ago
by
Rafael S Castilho
Browse files
Options
Downloads
Patches
Plain Diff
SCRUM#81
: fixed spelling error
Signed-off-by:
Rafael S Castilho
<
rsc15@inf.ufpr.br
>
parent
35389266
No related branches found
No related tags found
2 merge requests
!51
Merge development to master
,
!47
Issue/72
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/agent/linux/network_bandwidth.cpp
+12
-12
12 additions, 12 deletions
src/agent/linux/network_bandwidth.cpp
test/returnTest.bats
+16
-16
16 additions, 16 deletions
test/returnTest.bats
with
28 additions
and
28 deletions
src/agent/linux/network_bandwidth.cpp
+
12
−
12
View file @
e8f9bf43
...
@@ -44,13 +44,13 @@ Json::Value get_net_bandwidth() {
...
@@ -44,13 +44,13 @@ Json::Value get_net_bandwidth() {
pack_tr_allt
=
0
;
pack_tr_allt
=
0
;
}
else
{
}
else
{
b_rec_allt
=
b_rec_allt
=
net_band_all_time
[
"data_net"
][
"bytes_recived"
].
asLargestUInt
();
net_band_all_time
[
"data_net"
][
"bytes_rec
e
ived"
].
asLargestUInt
();
pack_rec_allt
=
pack_rec_allt
=
net_band_all_time
[
"data_net"
][
"packets_recived"
].
asLargestUInt
();
net_band_all_time
[
"data_net"
][
"packets_rec
e
ived"
].
asLargestUInt
();
b_tr_allt
=
b_tr_allt
=
net_band_all_time
[
"data_net"
][
"bytes_transmited"
].
asLargestUInt
();
net_band_all_time
[
"data_net"
][
"bytes_transmit
t
ed"
].
asLargestUInt
();
pack_tr_allt
=
pack_tr_allt
=
net_band_all_time
[
"data_net"
][
"packets_tranmited"
].
asLargestUInt
();
net_band_all_time
[
"data_net"
][
"packets_tranmit
t
ed"
].
asLargestUInt
();
}
}
...
@@ -182,10 +182,10 @@ Json::Value get_net_bandwidth() {
...
@@ -182,10 +182,10 @@ Json::Value get_net_bandwidth() {
pack_tr
=
atoll
(
t
.
substr
(
j
,
len
).
c_str
());
pack_tr
=
atoll
(
t
.
substr
(
j
,
len
).
c_str
());
ofs
.
open
(
"net_band.json"
,
std
::
ios
::
trunc
);
ofs
.
open
(
"net_band.json"
,
std
::
ios
::
trunc
);
net_band_all_time
[
"data_net"
][
"bytes_recived"
]
=
b_rec
;
net_band_all_time
[
"data_net"
][
"bytes_rec
e
ived"
]
=
b_rec
;
net_band_all_time
[
"data_net"
][
"packets_recived"
]
=
pack_rec
;
net_band_all_time
[
"data_net"
][
"packets_rec
e
ived"
]
=
pack_rec
;
net_band_all_time
[
"data_net"
][
"bytes_transmited"
]
=
b_tr
;
net_band_all_time
[
"data_net"
][
"bytes_transmit
t
ed"
]
=
b_tr
;
net_band_all_time
[
"data_net"
][
"packets_tranmited"
]
=
pack_tr
;
net_band_all_time
[
"data_net"
][
"packets_tranmit
t
ed"
]
=
pack_tr
;
ofs
<<
net_band_all_time
;
ofs
<<
net_band_all_time
;
ofs
.
close
();
ofs
.
close
();
////////////////////////////////////////////////////
////////////////////////////////////////////////////
...
@@ -196,10 +196,10 @@ Json::Value get_net_bandwidth() {
...
@@ -196,10 +196,10 @@ Json::Value get_net_bandwidth() {
getline
(
time_file
,
str
);
getline
(
time_file
,
str
);
time_file
.
close
();
time_file
.
close
();
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
net_band
[
"data_net"
][
"bytes_recived"
]
=
b_rec
-
b_rec_allt
;
net_band
[
"data_net"
][
"bytes_rec
e
ived"
]
=
b_rec
-
b_rec_allt
;
net_band
[
"data_net"
][
"packets_recived"
]
=
pack_rec
-
pack_rec_allt
;
net_band
[
"data_net"
][
"packets_rec
e
ived"
]
=
pack_rec
-
pack_rec_allt
;
net_band
[
"data_net"
][
"bytes_transmited"
]
=
b_tr
-
b_tr_allt
;
net_band
[
"data_net"
][
"bytes_transmit
t
ed"
]
=
b_tr
-
b_tr_allt
;
net_band
[
"data_net"
][
"packets_tranmited"
]
=
pack_tr
-
pack_tr_allt
;
net_band
[
"data_net"
][
"packets_tranmit
t
ed"
]
=
pack_tr
-
pack_tr_allt
;
net_band
[
"data_net"
][
"collect_time"
]
=
str
;
net_band
[
"data_net"
][
"collect_time"
]
=
str
;
myfile
.
close
();
myfile
.
close
();
return
(
net_band
);
return
(
net_band
);
...
...
This diff is collapsed.
Click to expand it.
test/returnTest.bats
+
16
−
16
View file @
e8f9bf43
...
@@ -43,23 +43,23 @@ function processor() {
...
@@ -43,23 +43,23 @@ function processor() {
[[ "$obj" != "null" ]]
[[ "$obj" != "null" ]]
}
}
function bytes_recived() {
function bytes_rec
e
ived() {
obj=$(cat net.json | jq -r '.data_net.bytes_recived')
obj=$(cat net.json | jq -r '.data_net.bytes_rec
e
ived')
[[ "$obj" -ge 0 ]]
[[ "$obj" -ge 0 ]]
}
}
function bytes_transmited() {
function bytes_transmit
t
ed() {
obj=$(cat net.json | jq -r '.data_net.bytes_transmited')
obj=$(cat net.json | jq -r '.data_net.bytes_transmit
t
ed')
[[ "$obj" -ge 0 ]]
[[ "$obj" -ge 0 ]]
}
}
function packets_recived() {
function packets_rec
e
ived() {
obj=$(cat net.json | jq -r '.data_net.packets_recived')
obj=$(cat net.json | jq -r '.data_net.packets_rec
e
ived')
[[ "$obj" -ge 0 ]]
[[ "$obj" -ge 0 ]]
}
}
function packets_transmited() {
function packets_transmit
t
ed() {
obj=$(cat net.json | jq -r '.data_net.packets_transmited')
obj=$(cat net.json | jq -r '.data_net.packets_transmit
t
ed')
[[ "$obj" -ge 0 ]]
[[ "$obj" -ge 0 ]]
}
}
...
@@ -81,23 +81,23 @@ teardown() {
...
@@ -81,23 +81,23 @@ teardown() {
rm -f net.json
rm -f net.json
}
}
@test "Bytes Recived" {
@test "Bytes Rec
e
ived" {
run bytes_recived
run bytes_rec
e
ived
[ "$status" -eq 0 ]
[ "$status" -eq 0 ]
}
}
@test "Bytes Transmited" {
@test "Bytes Transmit
t
ed" {
run bytes_transmited
run bytes_transmit
t
ed
[ "$status" -eq 0 ]
[ "$status" -eq 0 ]
}
}
@test "Packets Recived" {
@test "Packets Rec
e
ived" {
run packets_recived
run packets_rec
e
ived
[ "$status" -eq 0 ]
[ "$status" -eq 0 ]
}
}
@test "Packets Trasmited" {
@test "Packets Trasmit
t
ed" {
run packets_transmited
run packets_transmit
t
ed
[ "$status" -eq 0 ]
[ "$status" -eq 0 ]
}
}
...
...
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