This repository was archived by the owner on Mar 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
Metrics: PSS for a transfer rate of 1Gb #939
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
|
||
# This file is part of cc-oci-runtime. | ||
# | ||
# Copyright (C) 2017 Intel Corporation | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 2 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
# | ||
# Description: | ||
# Measures Proportional Set Size memory while running an | ||
# inter (docker<->docker) 1 Gb tranfer rate using nuttcp. | ||
# The selection of 1 Gb as a tranfer rate is because that is | ||
# the maximum that we can be handle in our testing infrastructure. | ||
|
||
set -e | ||
|
||
SCRIPT_PATH=$(dirname "$(readlink -f "$0")") | ||
|
||
source "${SCRIPT_PATH}/../../lib/test-common.bash" | ||
source "${SCRIPT_PATH}/lib/network-test-common.bash" | ||
|
||
function pss_memory { | ||
# Currently default nuttcp has a bug | ||
# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=745051 | ||
# Image name | ||
local image=gabyct/nuttcp | ||
# We wait for the test system to settle into a steady mode before we | ||
# measure the PSS. Thus, we have two times - the length of the time the | ||
# test runs for, and the time after which we sample the PSS | ||
# Time for the test to run (seconds) | ||
local total_time=6 | ||
# Time in which we sample the PSS (seconds) | ||
local middle_time=3 | ||
# Rate limit (speed at which transmitter send data, megabytes) | ||
# We will measure PSS with a specific transfer rate | ||
local rate_limit=1000 | ||
# Name of the containers | ||
local server_name="network-server" | ||
local client_name="network-client" | ||
# Arguments to run the client | ||
local extra_args="-d" | ||
|
||
setup | ||
local server_command="sleep 30" | ||
local server_address=$(start_server "$server_name" "$image" "$server_command") | ||
|
||
local client_command="/root/nuttcp -R${rate_limit}m -T${total_time} ${server_address}" | ||
local server_command="/root/nuttcp -S" | ||
$DOCKER_EXE exec ${server_name} sh -c "${server_command}" | ||
start_client "$extra_args" "$client_name" "$image" "$client_command" > /dev/null | ||
|
||
# Time when we are taking our PSS measurement | ||
echo >&2 "WARNING: sleeping for $middle_time seconds in order to sample the PSS" | ||
sleep ${middle_time} | ||
|
||
local memory_command="smem -c pss" | ||
${memory_command} -P @QEMU_PATH@ | tail -n 2 > "$result" | ||
local memory=$(awk '{ total += $1 } END { print total/NR }' "$result") | ||
echo "The PSS memory is : $memory Kb" | ||
|
||
echo >&2 "WARNING: This test is being affected by https://github.com/01org/cc-oci-runtime/issues/795" | ||
clean_environment "$server_name" | ||
$DOCKER_EXE rm -f ${client_name} > /dev/null | ||
} | ||
|
||
pss_memory |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new test needs to be added to https://github.com/01org/cc-oci-runtime/blob/master/tests/metrics/network/README.md.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jodh-intel when #946 is merged then I can add it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or I can add another PR for the modification of the README