Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flame-clmc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
flame
flame-clmc
Commits
27def344
Commit
27def344
authored
6 years ago
by
Nikolay Stanchev
Browse files
Options
Downloads
Patches
Plain Diff
Fixes bug with empty array in the graph pipeline script
parent
916792f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/clmc-service/graph-pipeline.sh
+24
-19
24 additions, 19 deletions
scripts/clmc-service/graph-pipeline.sh
with
24 additions
and
19 deletions
scripts/clmc-service/graph-pipeline.sh
+
24
−
19
View file @
27def344
...
...
@@ -61,34 +61,39 @@ do
echo
"Received request uuid
${
graph_uuid
}
"
echo
"Timestamp to use for measurement
${
timestamp
}
"
echo
"Received endpoints:
${
endpoints
[@]
}
"
for
endpoint
in
${
endpoints
[@]
}
;
do
for
ue
in
${
ues
[@]
}
;
do
# check the count of the received endpoints, otherwise an empty array will be considered as an unset variable
if
[[
${#
endpoints
[@]
}
-eq
0
]]
;
then
echo
"The list of endpoints returned by the build request is empty"
else
echo
"Received endpoints:
${
endpoints
[@]
}
"
for
endpoint
in
${
endpoints
[@]
}
;
do
for
ue
in
${
ues
[@]
}
;
do
echo
"Querying for round-trip time..."
response
=
$(
curl
-s
-X
GET
"http://
${
CLMC_IP
}
/clmc-service/graph/temporal/
${
graph_uuid
}
/round-trip-time?startpoint=
${
ue
}
&endpoint=
${
endpoint
}
"
)
echo
"Querying for round-trip time..."
response
=
$(
curl
-s
-X
GET
"http://
${
CLMC_IP
}
/clmc-service/graph/temporal/
${
graph_uuid
}
/round-trip-time?startpoint=
${
ue
}
&endpoint=
${
endpoint
}
"
)
global_tags
=
$(
echo
${
response
}
| jq
-r
'.global_tags | to_entries | map("\(.key)=\(.value|tostring)") | join(",")'
)
echo
"Global tags:
${
global_tags
}
"
global_tags
=
$(
echo
${
response
}
| jq
-r
'.global_tags | to_entries | map("\(.key)=\(.value|tostring)") | join(",")'
)
echo
"Global tags:
${
global_tags
}
"
local_tags
=
$(
echo
${
response
}
| jq
-r
'.local_tags | to_entries | map("\(.key)=\(.value|tostring)") | join (",")'
)
echo
"Local tags:
${
local_tags
}
"
local_tags
=
$(
echo
${
response
}
| jq
-r
'.local_tags | to_entries | map("\(.key)=\(.value|tostring)") | join (",")'
)
echo
"Local tags:
${
local_tags
}
"
fields
=
$(
echo
${
response
}
| jq
-r
'. | "\(.round_trip_time) \(.response_time) \(.total_forward_latency)"'
)
read
rtt service_delay network_delay
<<<
${
fields
}
fields
=
$(
echo
${
response
}
| jq
-r
'. | "\(.round_trip_time) \(.response_time) \(.total_forward_latency)"'
)
read
rtt service_delay network_delay
<<<
${
fields
}
echo
"Round-trip-time:
${
rtt
}
"
echo
"Service delay:
${
service_delay
}
"
echo
"Network latency
${
network_delay
}
"
echo
"Round-trip-time:
${
rtt
}
"
echo
"Service delay:
${
service_delay
}
"
echo
"Network latency
${
network_delay
}
"
measurement_line
=
"
${
results_measurement
}
,
${
global_tags
}
,
${
local_tags
}
round_trip_time=
${
rtt
}
,service_delay=
${
service_delay
}
,network_delay=
${
network_delay
}
${
timestamp
}
"
echo
"Measurement line:
${
measurement_line
}
"
response
=
$(
curl
-si
-X
POST
"http://
${
CLMC_IP
}
/influxdb/write?db=
${
db_name
}
"
--data-binary
"
${
measurement_line
}
"
)
echo
"InfluxDB response:
${
response
}
"
measurement_line
=
"
${
results_measurement
}
,
${
global_tags
}
,
${
local_tags
}
round_trip_time=
${
rtt
}
,service_delay=
${
service_delay
}
,network_delay=
${
network_delay
}
${
timestamp
}
"
echo
"Measurement line:
${
measurement_line
}
"
response
=
$(
curl
-si
-X
POST
"http://
${
CLMC_IP
}
/influxdb/write?db=
${
db_name
}
"
--data-binary
"
${
measurement_line
}
"
)
echo
"InfluxDB response:
${
response
}
"
done
done
done
fi
echo
"Deleting temporal graph..."
response
=
$(
curl
-s
-X
DELETE
"http://
${
CLMC_IP
}
/clmc-service/graph/temporal/
${
graph_uuid
}
"
)
...
...
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