public class TestParse_iostat extends AbstractParserTestCase
iostat
. This is not the same as the utility we
support under linux. iostat -d -C -n 999 -w 60
provides an
update every 60 seconds. The -d tells it to report just device statistics (it
will report CPU and load average statistics as well by default). The "-C"
option tells it that you want the CPU stats anyway (this includes IOWait). (A
"-U" option may be used to explicitly request the load average stats.) The
"-n 999" tells it to display up to 999 devices. Otherwise it will truncate
the output at 80 columns.
disk0 disk1 disk2 disk3 disk4 cpu KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us sy id 197.14 26 5.10 79.10 1 0.07 3.74 0 0.00 41.31 0 0.00 13.03 0 0.00 31 6 63 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 53 4 43 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 56 8 37 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 54 9 37 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 57 8 35The output of this command depends on the #of devices which are attached, and that can actually change over time (device connect/disconnect). Unless we are going to aggregate across the devices reported in each time period it might make more sense to only use this for the CPU stats, which can be done by specifying "-n 0" for NO devices.
iostat -d -C -n 0 -w 1 | cat cpu us sy id 31 6 63 57 8 35 57 6 37Regardless, the headers will repeat periodically.
TestCase2.MyProperties, TestCase2.RandomType
_randomType, log
Constructor and Description |
---|
TestParse_iostat() |
TestParse_iostat(String name) |
Modifier and Type | Method and Description |
---|---|
void |
test_iostat_collector_correct() |
protected void |
test_iostat_collector(String output) |
void |
test_parsing_iostat_cpu_only()
Test parsing of a CPU only report from
iostat -d -C -n 0 -w 1 | cat |
void |
test_parsing_iostat_devices_plus_cpu()
Test parsing of the output of
iostat -d -C -n 999 -w 60 |
assertField
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getProperties, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logProperties
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
public TestParse_iostat()
public TestParse_iostat(String name)
public void test_parsing_iostat_cpu_only()
iostat -d -C -n 0 -w 1 | cat
public void test_parsing_iostat_devices_plus_cpu()
iostat -d -C -n 999 -w 60
disk0 disk1 disk2 disk3 disk4 cpu KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us sy id 197.14 26 5.10 79.10 1 0.07 3.74 0 0.00 41.31 0 0.00 13.03 0 0.00 31 6 63 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 53 4 43 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 56 8 37 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 54 9 37 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 57 8 35Note that the #of device columns will vary for this format. The headers will also periodically repeat. The #of columns for the report can presumably vary as devices are connected and disconnected!
public void test_iostat_collector_correct() throws IOException, InterruptedException
IOException
InterruptedException
protected void test_iostat_collector(String output) throws IOException, InterruptedException
IOException
InterruptedException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.