Skip to content

Commit

Permalink
Use registration.json format instead of switches.json to get uplink s…
Browse files Browse the repository at this point in the history
…peed (#260)

* Get uplink speed from registration.json instead of switches.json

Now that we are going to support minimal sites with only a single machine and
now switch we can no longer reliably get ulink speed information from the
switches.json siteinfo format, since minimal sites don't have a switch. This
commit changes the source for getting the uplink speed to the registration.json
format.

* Adds missing pipe to jq in configure_tc_fq.sh
  • Loading branch information
nkinkade authored Apr 10, 2024
1 parent c9ac7d6 commit 05caa82
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions configs/stage3_ubuntu/opt/mlab/bin/configure_tc_fq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ function write_metric_file {
chmod 644 $METRIC_FILE
}

SITE=${HOSTNAME:6:5}
SPEED=$(curl --silent --show-error --location \
https://siteinfo.mlab-oti.measurementlab.net/v1/sites/switches.json \
| jq -r ".${SITE}.uplink_speed")
SPEED=$(
curl --silent --show-error --location \
https://siteinfo.mlab-oti.measurementlab.net/v2/sites/registration.json \
| jq -r ".[\"${HOSTNAME}\"] | .Uplink"
)

# Internally, tc stores rates as 32-bit unsigned integers in bps (bytes per
# second). Because of this, and to make comparisons easier later in the script,
Expand Down

0 comments on commit 05caa82

Please sign in to comment.