Skip to content

Commit

Permalink
test(datasource): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Thuan Vo committed Sep 29, 2022
1 parent f9fe68d commit 78211cd
Show file tree
Hide file tree
Showing 23 changed files with 622 additions and 111 deletions.
372 changes: 314 additions & 58 deletions src/test/java/io/cryostat/jfr/datasource/server/DatasourceTest.java

Large diffs are not rendered by default.

342 changes: 294 additions & 48 deletions src/test/java/io/cryostat/jfr/datasource/server/NativeDatasourceIT.java

Large diffs are not rendered by default.

Binary file removed src/test/resources/jmc.cpu.jfr
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"app":"dashboard","requestId":"Q237","timezone":"browser","panelId":40,"dashboardId":1,"range":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z","raw":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z"}},"timeInfo":"","interval":"1s","intervalMs":1000,"targets":[{"target":"events.custom.recordingDuration","refId":"A","type":"table"}],"maxDataPoints":910,"scopedVars":{"__interval":{"text":"1s","value":"1s"},"__interval_ms":{"text":"1000","value":1000}},"startTime":1663801226046,"rangeRaw":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z"},"adhocFilters":[]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"rows":[[619867]],"columns":[{"text":"Duration","type":"number"}]}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"app":"dashboard","requestId":"Q237","timezone":"browser","panelId":40,"dashboardId":1,"range":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z","raw":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z"}},"timeInfo":"","interval":"1s","intervalMs":1000,"targets":[{"target":"events.custom.startTime","refId":"A","type":"table"}],"maxDataPoints":910,"scopedVars":{"__interval":{"text":"1s","value":"1s"},"__interval_ms":{"text":"1000","value":1000}},"startTime":1663801226046,"rangeRaw":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z"},"adhocFilters":[]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"rows":[[1663785541195]],"columns":[{"text":"Start Time","type":"number"}]}]
1 change: 1 addition & 0 deletions src/test/resources/queries/query.table.input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"app":"dashboard","requestId":"Q237","timezone":"browser","panelId":40,"dashboardId":1,"range":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z","raw":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z"}},"timeInfo":"","interval":"1s","intervalMs":1000,"targets":[{"target":"jdk.ObjectAllocationSample.objectClass","refId":"A","type":"table"}],"maxDataPoints":910,"scopedVars":{"__interval":{"text":"1s","value":"1s"},"__interval_ms":{"text":"1000","value":1000}},"startTime":1663801226046,"rangeRaw":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z"},"adhocFilters":[]}
1 change: 1 addition & 0 deletions src/test/resources/queries/query.table.output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"type":"table","rows":[[1663785562002,"java.util.HashMap$KeyIterator"],[1663785562052,"java.lang.management.MemoryUsage[]"],[1663785562053,"java.util.ArrayList"],[1663785562053,"java.util.ArrayList"],[1663785562053,"jdk.jfr.events.ContainerConfigurationEvent"],[1663785562058,"java.util.HashMap$Node[]"],[1663785562064,"java.util.Collections$UnmodifiableCollection$1"],[1663785562070,"java.lang.String"],[1663785562070,"java.io.ObjectStreamClass$WeakClassKey"],[1663785562210,"java.util.WeakHashMap$EntryIterator"],[1663785562352,"java.util.TreeMap$Entry"],[1663785562352,"java.util.Collections$UnmodifiableCollection$1"],[1663785562352,"java.lang.Object[]"],[1663785562355,"java.lang.Object[]"],[1663785571092,"char[]"],[1663785571093,"java.lang.Object[]"],[1663785571093,"byte[]"],[1663785571094,"jdk.internal.org.objectweb.asm.SymbolTable$Entry"],[1663785571095,"byte[]"],[1663785601048,"byte[]"],[1663785601049,"char[]"],[1663785601049,"java.nio.HeapByteBuffer"],[1663785601049,"java.util.ArrayList"],[1663785631003,"byte[]"],[1663785631003,"java.util.ArrayList$SubList"],[1663785631003,"byte[]"],[1663785631004,"char[]"],[1663785660957,"byte[]"],[1663785660957,"java.lang.Object"],[1663785660957,"char[]"],[1663785660957,"java.lang.Object[]"],[1663785690906,"byte[]"],[1663785690906,"jdk.internal.ref.CleanerImpl$PhantomCleanableRef"],[1663785690906,"char[]"],[1663785690906,"jdk.internal.ref.CleanerImpl$PhantomCleanableRef"],[1663785690906,"java.lang.Object[]"],[1663785720859,"byte[]"],[1663785720859,"java.lang.Object[]"],[1663785720859,"byte[]"],[1663785720860,"char[]"],[1663785750821,"sun.nio.cs.UTF_8$Decoder"],[1663785750821,"byte[]"],[1663785750822,"char[]"],[1663785780774,"sun.nio.cs.UTF_8$Decoder"],[1663785780774,"char[]"],[1663785780774,"byte[]"],[1663785810726,"byte[]"],[1663785810726,"byte[]"],[1663785810726,"char[]"],[1663785810726,"java.nio.HeapByteBuffer"],[1663785810727,"java.util.ArrayList"],[1663785840687,"byte[]"],[1663785840687,"java.util.ArrayList"],[1663785840687,"java.nio.HeapByteBuffer"],[1663785840688,"byte[]"],[1663785870638,"char[]"],[1663785870638,"jdk.internal.ref.CleanerImpl$PhantomCleanableRef"],[1663785870639,"char[]"],[1663785870639,"java.util.ArrayList$SubList"],[1663785900590,"byte[]"],[1663785900591,"java.nio.HeapByteBuffer"],[1663785900591,"char[]"],[1663785900591,"java.nio.HeapByteBuffer"],[1663785900591,"java.util.ArrayList"],[1663785930550,"byte[]"],[1663785930550,"java.util.ArrayList$SubList"],[1663785930550,"byte[]"],[1663785930550,"char[]"],[1663785960506,"sun.nio.cs.UTF_8$Decoder"],[1663785960506,"char[]"],[1663785960507,"byte[]"],[1663785990458,"byte[]"],[1663785990458,"byte[]"],[1663785990459,"char[]"],[1663785990459,"java.nio.HeapByteBuffer"],[1663785990460,"java.util.ArrayList"],[1663786020419,"byte[]"],[1663786020419,"java.util.ArrayList$SubList"],[1663786020419,"byte[]"],[1663786020420,"char[]"],[1663786050378,"sun.nio.cs.UTF_8$Decoder"],[1663786050378,"char[]"],[1663786050378,"byte[]"],[1663786080331,"byte[]"],[1663786080331,"byte[]"],[1663786080331,"byte[]"],[1663786080332,"java.nio.HeapCharBuffer"],[1663786110283,"byte[]"],[1663786110283,"java.util.HashMap$Node[]"],[1663786110283,"char[]"],[1663786110283,"java.util.ArrayList$SubList"],[1663786140238,"byte[]"],[1663786140238,"sun.nio.cs.UTF_8$Decoder"],[1663786140239,"char[]"],[1663786140239,"int[]"],[1663786161060,"java.util.ArrayList"],[1663786161060,"java.util.LinkedHashMap"],[1663786161060,"java.util.HashMap$Node[]"],[1663786161060,"java.util.HashMap"],[1663786161060,"java.util.HashSet"],[1663786161060,"java.util.LinkedHashMap$Entry"],[1663786161060,"java.lang.String"],[1663786161060,"byte[]"],[1663786161060,"java.lang.String"],[1663786161060,"java.util.HashMap$Node"],[1663786161061,"java.util.LinkedHashMap$LinkedEntryIterator"],[1663786161061,"java.lang.String"],[1663786161061,"java.util.ArrayList$Itr"]],"columns":[{"text":"Time","type":"time"},{"text":"objectClass","type":"string"}]}]
1 change: 1 addition & 0 deletions src/test/resources/queries/query.timeseries.input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"app":"dashboard","requestId":"Q237","timezone":"browser","panelId":40,"dashboardId":1,"range":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z","raw":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z"}},"timeInfo":"","interval":"1s","intervalMs":1000,"targets":[{"target":"jdk.ObjectAllocationSample.weight","refId":"A","type":"timeserie"}],"maxDataPoints":910,"scopedVars":{"__interval":{"text":"1s","value":"1s"},"__interval_ms":{"text":"1000","value":1000}},"startTime":1663801226046,"rangeRaw":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z"},"adhocFilters":[]}
1 change: 1 addition & 0 deletions src/test/resources/queries/query.timeseries.output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"target":"jdk.ObjectAllocationSample.weight","datapoints":[[2020664.0,1663785562002],[23088.0,1663785562052],[40552.0,1663785562053],[24864.0,1663785562053],[391208.0,1663785562053],[517560.0,1663785562058],[518112.0,1663785562064],[2272.0,1663785562070],[528896.0,1663785562070],[1432.0,1663785562210],[517616.0,1663785562352],[44176.0,1663785562352],[1456.0,1663785562352],[517600.0,1663785562355],[101200.0,1663785571092],[100384.0,1663785571093],[83240.0,1663785571093],[92152.0,1663785571094],[59320.0,1663785571095],[174488.0,1663785601048],[65616.0,1663785601049],[67528.0,1663785601049],[59376.0,1663785601049],[67560.0,1663785631003],[75744.0,1663785631003],[108384.0,1663785631003],[66856.0,1663785631004],[116720.0,1663785660957],[75784.0,1663785660957],[73824.0,1663785660957],[59352.0,1663785660957],[100376.0,1663785690906],[75760.0,1663785690906],[73824.0,1663785690906],[59376.0,1663785690906],[59344.0,1663785690906],[67584.0,1663785720859],[75752.0,1663785720859],[108512.0,1663785720859],[66856.0,1663785720860],[191512.0,1663785750821],[78928.0,1663785750821],[66856.0,1663785750822],[191472.0,1663785780774],[73824.0,1663785780774],[59376.0,1663785780774],[100400.0,1663785810726],[75712.0,1663785810726],[65616.0,1663785810726],[67528.0,1663785810726],[59392.0,1663785810727],[67568.0,1663785840687],[75760.0,1663785840687],[108536.0,1663785840687],[58656.0,1663785840688],[132176.0,1663785870638],[67528.0,1663785870638],[73824.0,1663785870639],[59360.0,1663785870639],[100376.0,1663785900590],[75760.0,1663785900591],[73824.0,1663785900591],[59376.0,1663785900591],[59376.0,1663785900591],[67560.0,1663785930550],[75744.0,1663785930550],[108384.0,1663785930550],[66856.0,1663785930550],[191512.0,1663785960506],[73824.0,1663785960506],[59376.0,1663785960507],[100424.0,1663785990458],[75648.0,1663785990458],[65616.0,1663785990459],[67528.0,1663785990459],[59376.0,1663785990460],[67560.0,1663786020419],[75744.0,1663786020419],[108384.0,1663786020419],[66856.0,1663786020420],[191512.0,1663786050378],[73824.0,1663786050378],[31392.0,1663786050378],[100336.0,1663786080331],[75608.0,1663786080331],[83608.0,1663786080331],[108552.0,1663786080332],[124992.0,1663786110283],[75720.0,1663786110283],[73824.0,1663786110283],[59392.0,1663786110283],[100368.0,1663786140238],[75752.0,1663786140238],[115704.0,1663786140239],[75728.0,1663786140239],[752.0,1663786161060],[36704.0,1663786161060],[36760.0,1663786161060],[36736.0,1663786161060],[36752.0,1663786161060],[36712.0,1663786161060],[36744.0,1663786161060],[36728.0,1663786161060],[36728.0,1663786161060],[36728.0,1663786161060],[36720.0,1663786161061],[704.0,1663786161061],[36720.0,1663786161061]],"meta":{}}]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"app":"dashboard","requestId":"Q237","timezone":"browser","panelId":40,"dashboardId":1,"range":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z","raw":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z"}},"timeInfo":"","interval":"1s","intervalMs":1000,"targets":[{"target":"jdk.ObjectAllocationSample.weight?objectClass=java.util.ArrayList,java.lang.String","refId":"A","type":"timeserie"}],"maxDataPoints":910,"scopedVars":{"__interval":{"text":"1s","value":"1s"},"__interval_ms":{"text":"1000","value":1000}},"startTime":1663801226046,"rangeRaw":{"from":"2022-09-21T18:37:59.240Z","to":"2022-09-21T18:50:07.014Z"},"adhocFilters":[]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"target":"java.lang.String","datapoints":[[2272.0,1663785562070],[36744.0,1663786161060],[36728.0,1663786161060],[704.0,1663786161061]],"meta":{"paramField":"objectClass"}},{"target":"java.util.ArrayList","datapoints":[[40552.0,1663785562053],[24864.0,1663785562053],[59376.0,1663785601049],[59392.0,1663785810727],[75760.0,1663785840687],[59376.0,1663785900591],[59376.0,1663785990460],[752.0,1663786161060]],"meta":{"paramField":"objectClass"}}]
1 change: 0 additions & 1 deletion src/test/resources/query.table.input.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/test/resources/query.table.output.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/test/resources/query.timeseries.input.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/test/resources/query.timeseries.output.txt

This file was deleted.

Binary file added src/test/resources/recording.jfr
Binary file not shown.
1 change: 0 additions & 1 deletion src/test/resources/search.output.txt

This file was deleted.

1 change: 1 addition & 0 deletions src/test/resources/searches/search.events.input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"target":"*"}
1 change: 1 addition & 0 deletions src/test/resources/searches/search.events.output.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/test/resources/searches/search.target.input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"target":"jdk.ObjectAllocationSample.objectClass"}
Loading

0 comments on commit 78211cd

Please sign in to comment.