Skip to content

Commit

Permalink
Script changed, so that an markdown file (wiki format) is generated a…
Browse files Browse the repository at this point in the history
…nd metrics look proper
  • Loading branch information
ivrodr-msft committed Jul 4, 2016
1 parent c831218 commit 8bad8fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions Tests/EndToEndTests/MetricsDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ def __init__(self, suite, name, testDir):
self.fullName = suite + "/" + name
self.testDir = testDir
self.baselineList = []

self.gitHash = ""
self.hardwareInfo = ""
self.gpuInfo = ""

@staticmethod
def discoverAllExamples():
Expand All @@ -98,7 +100,7 @@ def discoverAllExamples():
exampleName = os.path.basename(dirName)
suiteDir = os.path.dirname(dirName)
# suite name will be derived from the path components
suiteName = os.path.relpath(suiteDir, testsDir).replace('\\', '/')
suiteName = os.path.relpath(suiteDir, testsDir).replace('\\', '/')

example = Example(suiteName, exampleName, testDir)
Example.allExamplesIndexedByFullName[example.fullName.lower()] = example
Expand All @@ -116,26 +118,25 @@ def findBaselineFilesList(self):
for flavor in flavors:
candidateName = "baseline" + o + flavor + device + ".txt"
fullPath = td.cygpath(os.path.join(self.testDir, candidateName), relative=True)
if os.path.isfile(fullPath):
if os.path.isfile(fullPath):
baseline = Baseline(fullPath);
baselineFilesList.append(baseline)

return baselineFilesList

# extracts information for every example and stores it in Example.allExamplesIndexedByFullName
def getExamplesMetrics():
Example.allExamplesIndexedByFullName = list(sorted(Example.allExamplesIndexedByFullName.values(), key=lambda test: test.fullName))

Example.allExamplesIndexedByFullName = list(sorted(Example.allExamplesIndexedByFullName.values(), key=lambda test: test.fullName))
allExamples = Example.allExamplesIndexedByFullName

print ("CNTK - Metrics collector")
print ("CNTK - Metrics collector")

for example in allExamples:
baselineListForExample = example.findBaselineFilesList()
for example in allExamples:
baselineListForExample = example.findBaselineFilesList()
six.print_("Example: " + example.fullName)
for baseline in baselineListForExample:
for baseline in baselineListForExample:
with open(baseline.fullPath, "r") as f:
baselineContent = f.read()
baselineContent = f.read()
gitHash = re.search('.*Build SHA1:\s([a-z0-9]{40})[\r\n]+', baselineContent, re.MULTILINE)
if gitHash is None:
continue
Expand Down Expand Up @@ -181,11 +182,11 @@ def writeMetricsToAsciidoc():
metricsFile.write("\n|====\n\n")

six.print_("==============================================================================")

# ======================= Entry point =======================
# discover all the tests
Example.discoverAllExamples()

getExamplesMetrics()

writeMetricsToAsciidoc()
writeMetricsToAsciidoc()
2 changes: 1 addition & 1 deletion Tests/EndToEndTests/run-test-common
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ printHardwareInfo()
{
cpuName=$(cat /proc/cpuinfo 2> /dev/null | grep -m 1 'model name' | cut -d : -f 2- | tr -s " " | cut -c 2-)
totalMemory=$(cat /proc/meminfo 2> /dev/null | grep 'MemTotal' | cut -d : -f 2- | tr -s " " | cut -c 2-)
nproc=$(nproc)
nproc=$(nproc)

# Note that MetricsDriver.py depends on this format
echo "CPU info:"
Expand Down

0 comments on commit 8bad8fc

Please sign in to comment.