diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_empty.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_empty.png new file mode 100644 index 000000000..fbb751ba8 Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_empty.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_single_ptile.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_single_ptile.png new file mode 100644 index 000000000..72ddc4c33 Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_single_ptile.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_timer_log.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_timer_log.png new file mode 100644 index 000000000..edd11c173 Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_timer_log.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_timer_power2.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_timer_power2.png new file mode 100644 index 000000000..2c797a677 Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_timer_power2.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_timer_sqrt.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_timer_sqrt.png new file mode 100644 index 000000000..160bfbe1e Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/dark_heatmap_timer_sqrt.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_empty.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_empty.png new file mode 100644 index 000000000..c8a226793 Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_empty.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_single_ptile.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_single_ptile.png new file mode 100644 index 000000000..af8fe023b Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_single_ptile.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_timer_log.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_timer_log.png new file mode 100644 index 000000000..958eabf65 Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_timer_log.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_timer_power2.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_timer_power2.png new file mode 100644 index 000000000..99c3d79b9 Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_timer_power2.png differ diff --git a/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_timer_sqrt.png b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_timer_sqrt.png new file mode 100644 index 000000000..2d3a5c112 Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/DefaultGraphEngineSuite/heatmap_timer_sqrt.png differ diff --git a/atlas-chart/src/test/resources/graphengine/data/heatmap_empty.json.gz b/atlas-chart/src/test/resources/graphengine/data/heatmap_empty.json.gz new file mode 100644 index 000000000..4fe42a378 Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/data/heatmap_empty.json.gz differ diff --git a/atlas-chart/src/test/resources/graphengine/data/heatmap_single_ptile.json.gz b/atlas-chart/src/test/resources/graphengine/data/heatmap_single_ptile.json.gz new file mode 100644 index 000000000..d21b1180b Binary files /dev/null and b/atlas-chart/src/test/resources/graphengine/data/heatmap_single_ptile.json.gz differ diff --git a/atlas-chart/src/test/scala/com/netflix/atlas/chart/PngGraphEngineSuite.scala b/atlas-chart/src/test/scala/com/netflix/atlas/chart/PngGraphEngineSuite.scala index 02fa7192b..7d3f7e0fd 100644 --- a/atlas-chart/src/test/scala/com/netflix/atlas/chart/PngGraphEngineSuite.scala +++ b/atlas-chart/src/test/scala/com/netflix/atlas/chart/PngGraphEngineSuite.scala @@ -22,7 +22,6 @@ import java.time.ZoneId import java.time.ZoneOffset import java.time.ZonedDateTime import java.time.temporal.ChronoUnit - import com.netflix.atlas.chart.model.PlotBound.AutoData import com.netflix.atlas.chart.model.PlotBound.Explicit import com.netflix.atlas.chart.model._ @@ -151,8 +150,14 @@ abstract class PngGraphEngineSuite extends FunSuite { } def loadV2(resource: String): GraphDef = { - Using.resource(Streams.gzip(Streams.resource(resource))) { in => - JsonCodec.decode(in) + if (resource.endsWith(".gz")) { + Using.resource(Streams.gzip(Streams.resource(resource))) { in => + JsonCodec.decode(in) + } + } else { + Using.resource(Streams.resource(resource)) { in => + JsonCodec.decode(in) + } } } @@ -804,6 +809,27 @@ abstract class PngGraphEngineSuite extends FunSuite { check("heatmap_timer.png", graphDef) } + test("heatmap_timer_log") { + val graphDef = loadV2(s"$dataDir/heatmap_timer.json.gz").adjustPlots( + _.copy(scale = Scale.LOGARITHMIC) + ) + check("heatmap_timer_log.png", graphDef) + } + + test("heatmap_timer_power2") { + val graphDef = loadV2(s"$dataDir/heatmap_timer.json.gz").adjustPlots( + _.copy(scale = Scale.POWER_2) + ) + check("heatmap_timer_power2.png", graphDef) + } + + test("heatmap_timer_sqrt") { + val graphDef = loadV2(s"$dataDir/heatmap_timer.json.gz").adjustPlots( + _.copy(scale = Scale.SQRT) + ) + check("heatmap_timer_sqrt.png", graphDef) + } + test("heatmap_timer2") { val graphDef = loadV2(s"$dataDir/heatmap_timer2.json.gz") check("heatmap_timer2.png", graphDef) @@ -880,10 +906,20 @@ abstract class PngGraphEngineSuite extends FunSuite { check("heatmap_timer_small.png", graphDef) } + test("heatmap_single_ptile") { + val graphDef = loadV2(s"$dataDir/heatmap_single_ptile.json.gz") + check("heatmap_single_ptile.png", graphDef) + } + test("heatmap_dist") { val graphDef = loadV2(s"$dataDir/heatmap_dist.json.gz") check("heatmap_dist.png", graphDef) } + + test("heatmap_empty") { + val graphDef = loadV2(s"$dataDir/heatmap_empty.json.gz") + check("heatmap_empty.png", graphDef) + } } case class GraphData( diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala index 519f060b1..78a4e159c 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/graph/GrapherSuite.scala @@ -492,7 +492,7 @@ class GrapherSuite extends FunSuite { imageTest("heatmap params") { "/api/v1/graph?e=2012-01-01&q=name,sps,:eq,:sum,(,nf.cluster,),:by,:heatmap&heatmap_palette=greens&heatmap_scale=sqrt&heatmap_u=5&heatmap_label=foo" } - + imageTest("named colors: blue with light theme") { "/api/v1/graph?e=2012-01-01&q=1,blue1,:color,1,blue2,:color,1,blue3,:color&stack=1&theme=light" }