Skip to content

Commit e82142d

Browse files
piyushc01avamingli
authored andcommitted
gpcheckperf: fixing string parsing in parseMultiDDResult()
Issue: After updating gpssh to return string output, gpcheckperf failed to parse results. RCA: String before gpssh changes: "'multidd total bytes '" String after gpssh fix: "multidd total bytes '" In parseMultiDDResult(), str.Find() before gpssh changes were returning index 1 as it was getting string starting with "'". Post gpssh changes, substring is as the beginning of the string hence returning index 0. Fix: str.find() returns -1 if the substring is not found otherwise returns index. As the substring searched in parseMultiDDResult() is appearing at index zero, corrected condition to include index zero.
1 parent 957a7e8 commit e82142d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gpMgmt/bin/gpcheckperf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def parseMultiDDResult(out):
420420
o = line[i + 2:]
421421

422422

423-
if o.find('multidd total bytes ') > 0:
423+
if o.find('multidd total bytes ') >= 0:
424424
h = line[1:i]
425425
o = o.split()
426426
m = re.search("(^\d+)", o[-1])
@@ -429,7 +429,7 @@ def parseMultiDDResult(out):
429429
bytes = int(m.group(1))
430430
continue
431431

432-
if o.find('real') > 0:
432+
if o.find('real') >= 0:
433433
h = line[1:i]
434434
o = o.split()
435435
m = re.search("(^\d+.\d+)", o[1])

0 commit comments

Comments
 (0)