Skip to content

Commit

Permalink
Also print out missing tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Mats-SX committed Mar 24, 2016
1 parent fda7702 commit a8a89a4
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
package cypher.feature.reporting

import org.neo4j.cypher.internal.compiler.v3_1.ast.QueryTagger
import org.neo4j.cypher.internal.compiler.v3_1.ast.{QueryTagger, QueryTags}

import scala.collection.JavaConverters._
import scala.collection.immutable.ListMap
Expand Down Expand Up @@ -57,9 +57,11 @@ class JsonProducer(tagger: QueryTagger[String]) extends OutputProducer {
inner + ((tag, inner.getOrElse(tag, Int.box(0)) + 1))
}
}
println(tagCounts)
val withZeros = QueryTags.all.foldLeft(tagCounts) {
case (map, tag) => if (map.contains(tag.name)) map else map + ((tag.name, 0))
}

sortByValue(tagCounts).asJava
sortByValue(withZeros).asJava
}

private def sortByValue(map: Map[String, Integer]) = ListMap(map.toList.sortBy(_._2): _*)
Expand Down

0 comments on commit a8a89a4

Please sign in to comment.