Skip to content

Commit

Permalink
fixes distributed-system-analysis#227 - add *working* sar indexing su…
Browse files Browse the repository at this point in the history
…pport

Add unit tests for sar ingress under 'test-9'; Also:
	- fix existing unit tests for this branch;
	  - update line no.s for gold test 7.{3..5}. Refer distributed-system-analysis#303
	- update .gitignore: __pycache__ in any dir
	- cleanup sar-index code addition
  • Loading branch information
Archit Sharma committed Feb 25, 2017
1 parent cbef546 commit 5efd8ee
Show file tree
Hide file tree
Showing 22 changed files with 4,067 additions and 88 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
doc/*.html

__pycache__
configtools/bin/getconf.3.py
configtools/bin/getconf.py
configtools/bin/gethosts.3.py
configtools/bin/gethosts.py
configtools/build
.build
.rpm-copy
.spec-copy
mock-build.log
rpm.conf
*.swp
3 changes: 3 additions & 0 deletions server/pbench/bin/detect_nodename
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

head $1 | grep nodename | awk -F'=' '{print$2}' | sed 's#[">]##g'
27 changes: 27 additions & 0 deletions server/pbench/bin/extractsa
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

sa_data_file=$1
file_path=$(dirname "${sa_data_file}")
xml_file_path="$2"

sadf_type=$( { ${BASH_SOURCE%/*}/satools/oscode "$sa_data_file"; } 2>&1)

if [[ "$sadf_type" == *Invalid* ]]; then
sadf_type="f23"
echo "attempting to convert sa binary to compatible format.."
conversion_output=$( { LC_ALL=C ${BASH_SOURCE%/*}/vos/analysis/bin/sadf-f23-64 -c "$sa_data_file" > "${sa_data_file%/}".conv ; } 2>&1)
if [[ "$conversion_output" == *Invalid* ]]; then
echo "invalid input file! check if its a SA *binary* file.."
exit 1
fi
sa_data_file="${sa_data_file%/}".conv
fi

LC_ALL=C ${BASH_SOURCE%/*}/vos/analysis/bin/sadf-$sadf_type-64 -x "$sa_data_file" -- -A > "$xml_file_path"

client_nodename=$(${BASH_SOURCE%/*}/detect_nodename $xml_file_path)
echo "nodename: $client_nodename"

if [[ "$(basename $sa_data_file)" =~ ^.*\.conv$ ]]; then
rm "$sa_data_file"
fi
Loading

0 comments on commit 5efd8ee

Please sign in to comment.