(create-custom-fns custom time-opts)
create custom functions
(create-custom-fns [{:keys [:bench.stats.lag :bench.stats.time] :sample 10 :aggregate :max}] {:order :desc :key :start}) => (contains {:bench.stats.lag fn? :bench.stats.time fn?})
create custom functions (create-custom-fns [{:keys [:bench.stats.lag :bench.stats.time] :sample 10 :aggregate :max}] {:order :desc :key :start}) => (contains {:bench.stats.lag fn? :bench.stats.time fn?})
(create-merge-fn {:keys [sample aggregate none] :as m} time-opts)
creates a merge function
(def merge-fn (create-merge-fn {:sample 9} {:key identity :order :asc}))
(long (merge-fn (range 90))) => 44
creates a merge function (def merge-fn (create-merge-fn {:sample 9} {:key identity :order :asc})) (long (merge-fn (range 90))) => 44
(map-merge-fn {:keys [default time custom skip template]}
{time-key :key :as time-opts})
creates a map merge function
(map-merge-fn {:time {:aggregate :first} :default {:sample 4} :custom [{:keys [:bench.stats.lag] :sample 10 :aggregate :max} {:keys [:bench.stats.time] :sample 4 :aggregate :mean}]} {:order :desc :key :start}) => fn?
creates a map merge function (map-merge-fn {:time {:aggregate :first} :default {:sample 4} :custom [{:keys [:bench.stats.lag] :sample 10 :aggregate :max} {:keys [:bench.stats.time] :sample 4 :aggregate :mean}]} {:order :desc :key :start}) => fn?
(parse-transform-expr {:keys [interval time default custom] :as m}
type
time-opts)
parses the transform expr
parses the transform expr
(prep-merge {:keys [sample aggregate none] :or {aggregate :mean none 0}}
time-opts)
prepares the merge functions and options
(prep-merge {:sample [[0 :1m] :range]} {:unit :ms}) => (contains-in [fn? {:size {:type :to, :start [:array 0], :end [:time 60000]}, :strategy :range}])
prepares the merge functions and options (prep-merge {:sample [[0 :1m] :range]} {:unit :ms}) => (contains-in [fn? {:size {:type :to, :start [:array 0], :end [:time 60000]}, :strategy :range}])
(process arr {:keys [time transform computes] :as opts})
processes time series
processes time series
(process-compute arr {:keys [compute time]})
processes the indicator stage
(->> (process-compute [{:start 0 :bench.stats.lag 0.7 :bench.stats.time 0.3} {:start 2 :bench.stats.lag 0.3 :bench.stats.time 0.5} {:start 3 :bench.stats.lag 0.4 :bench.stats.time 0.3} {:start 4 :bench.stats.lag 0.5 :bench.stats.time 0.3}] {:compute {:lag [:s/norm :bench.stats.lag] :time [:s/norm :bench.stats.time]}}) (map (juxt :lag :time))) => [[1.0 0.6] [0.4285714285714286 1.0] [0.5714285714285715 0.6] [0.7142857142857143 0.6]]
processes the indicator stage (->> (process-compute [{:start 0 :bench.stats.lag 0.7 :bench.stats.time 0.3} {:start 2 :bench.stats.lag 0.3 :bench.stats.time 0.5} {:start 3 :bench.stats.lag 0.4 :bench.stats.time 0.3} {:start 4 :bench.stats.lag 0.5 :bench.stats.time 0.3}] {:compute {:lag [:s/norm :bench.stats.lag] :time [:s/norm :bench.stats.time]}}) (map (juxt :lag :time))) => [[1.0 0.6] [0.4285714285714286 1.0] [0.5714285714285715 0.6] [0.7142857142857143 0.6]]
(process-transform arr {:keys [transform template] time-opts :time})
processes the transform stage
processes the transform stage
(time-merge-fn {:keys [time]} time-opts)
creates a merge function for time
creates a merge function for time
(transform-interval arr {:keys [interval template merge-fn]} type time-opts)
transform array based on resolution
transform array based on resolution
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close