 
 (defn summarize [results]
   (-> results
-      (select-keys [:results
-                    :total-time
-                    :samples])
+      (select-keys [:total-time :samples])
       (merge {:system {:os (str (get-in results
                                         [:os-details :name])
                                 " "

                               (get test-name)
                               (var-get))]
      [test-name
       {:valid {:inputs valids
                :fn (wrapper test-fn true)}
        :invalid {:inputs invalids
                  :fn (wrapper test-fn false)}}])))


(defn prepare-benchmarks [alternatives inputs]
  (->> (for [[lib-name lib-ns] alternatives]
         [lib-name
          (->> (for [[test-name test-data] inputs]
                 (prepare-benchmark-for-lib lib-ns
                                            test-name
                                            test-data))
               (into {}))])

    (make-chart summary chart-path)))


(defn prepare-benchmark-for-lib [lib-name lib-ns test-name [valids invalids]]
  (let [publics (ns-publics lib-ns)
        wrapper (some-> publics
                        (get 'wrapper)
                        (var-get))
        assert-msg "invalid result for lib: %s, test: [%s %s], args: %%s"]
    (assert (some? wrapper)
            (str "No wrapper in" lib-ns))
    (assert (or (seq valids) (seq invalids)))
