Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cachelib/cachebench/vizualize/extract_latency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Note:
# For an even number of samples, this function returns the lower-middle
# value instead of averaging the two middle values. This is intentional
# for operational latency analysis.


input_logfile=$1
Expand Down Expand Up @@ -54,7 +58,7 @@ extract_latency() {

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

Expand All @@ -74,7 +78,8 @@ extract_bandwidth() {
# get the bandwidth
grep -e "$search" "$in" | \
tail -1 | \
awk '{print $10 " " $13}'
awk -F '[ ,]+' '{for(i=1;i<=NF;i++) if($i=="egressBytesPerSec") print $(i+2), $(i+5)}'

} | column -t > "$out"

# check if the file actually produced valid content
Expand Down