Skip to content

Commit a2f9b5a

Browse files
Improve robustness and fix minor typo
- Fix typo in latency error message - Clarify median selection behavior - Improve bandwidth parsing robustness (no behavior change)
1 parent f882c8f commit a2f9b5a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cachelib/cachebench/vizualize/extract_latency.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15+
# Note:
16+
# For an even number of samples, this function returns the lower-middle
17+
# value instead of averaging the two middle values. This is intentional
18+
# for operational latency analysis.
1519

1620

1721
input_logfile=$1
@@ -54,7 +58,7 @@ extract_latency() {
5458

5559
# check if the file actually produced valid content
5660
[[ "$(wc -l < "$out")" -eq "1" ]] && \
57-
echo "Incorrect log file. No latecny records found" || \
61+
echo "Incorrect log file. No latency records found" || \
5862
echo "$search latency written to $out"
5963
}
6064

@@ -74,7 +78,8 @@ extract_bandwidth() {
7478
# get the bandwidth
7579
grep -e "$search" "$in" | \
7680
tail -1 | \
77-
awk '{print $10 " " $13}'
81+
awk -F '[ ,]+' '{for(i=1;i<=NF;i++) if($i=="egressBytesPerSec") print $(i+2), $(i+5)}'
82+
7883
} | column -t > "$out"
7984

8085
# check if the file actually produced valid content

0 commit comments

Comments
 (0)