Skip to content
Draft
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class TraceRecord implements Serializable {
vol_ctxt: 'num', // -- /proc/$pid/status field 'voluntary_ctxt_switches'
inv_ctxt: 'num', // -- /proc/$pid/status field 'nonvoluntary_ctxt_switches'
hostname: 'str',
cpu_model: 'str'
cpu_model: 'str',
num_reclamations: 'num'
]

static public Map<String,Closure<String>> FORMATTER = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class TraceRecordTest extends Specification {
rss=146536
peak_vmem=323252
peak_rss=197136
num_reclamations=3
'''.stripIndent().leftTrim()

when:
Expand All @@ -192,12 +193,14 @@ class TraceRecordTest extends Specification {
trace.rss == 146536 * KB
trace.peak_vmem == 323252 * KB
trace.peak_rss == 197136 * KB
trace.num_reclamations == 3

trace.getFmtStr('%mem') == '0.9%'
trace.getFmtStr('vmem') == '315.5 MB'
trace.getFmtStr('rss') == '143.1 MB'
trace.getFmtStr('peak_vmem') == '315.7 MB'
trace.getFmtStr('peak_rss') == '192.5 MB'
trace.getFmtStr('num_reclamations') == '3'
}

def 'should parse a legacy trace file and return a TraceRecord object'() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ class TowerClientTest extends Specification {
expect:
tower.underscoreToCamelCase(STR) == EXPECTED
where:
STR | EXPECTED
'abc' | 'abc'
'a_b_c' | 'aBC'
'foo__bar' | 'fooBar'
STR | EXPECTED
'abc' | 'abc'
'a_b_c' | 'aBC'
'foo__bar' | 'fooBar'
'num_reclamations' | 'numReclamations'
}


Expand Down
Loading