two set workloads with different checkers

This commit is contained in:
Alex 2023-04-19 15:59:30 +02:00
parent 6eb26be548
commit 0bb1577ae1
3 changed files with 18 additions and 8 deletions

View file

@ -16,7 +16,8 @@
(def workloads (def workloads
"A map of workload names to functions that construct workloads, given opts." "A map of workload names to functions that construct workloads, given opts."
{"reg" reg/workload {"reg" reg/workload
"set" set/workload}) "set1" set/workload1
"set2" set/workload2})
(def cli-opts (def cli-opts
"Additional command line options." "Additional command line options."

View file

@ -120,10 +120,11 @@
(defn s3-list (defn s3-list
"Helper for ListObjects -- just lists everything in the bucket" "Helper for ListObjects -- just lists everything in the bucket"
[creds] [creds prefix]
(defn list-inner [ct accum] (defn list-inner [ct accum]
(let [list-result (s3/list-objects-v2 creds (let [list-result (s3/list-objects-v2 creds
{:bucket-name (:bucket creds) {:bucket-name (:bucket creds)
:prefix prefix
:continuation-token ct}) :continuation-token ct})
new-object-summaries (:object-summaries list-result) new-object-summaries (:object-summaries list-result)
new-objects (map (fn [d] (:key d)) new-object-summaries) new-objects (map (fn [d] (:key d)) new-object-summaries)

View file

@ -34,12 +34,12 @@
(grg/s3-put (:creds this) (str (:value op)) "present") (grg/s3-put (:creds this) (str (:value op)) "present")
(assoc op :type :ok)) (assoc op :type :ok))
:read :read
(let [items (grg/s3-list (:creds this))] (let [items (grg/s3-list (:creds this) "")]
(assoc op :type :ok, :value (set (map read-string items)))))) (assoc op :type :ok, :value (set (map read-string items))))))
(teardown! [this test]) (teardown! [this test])
(close! [this test])) (close! [this test]))
(defn workload (defn workload1
"Tests insertions and deletions" "Tests insertions and deletions"
[opts] [opts]
{:client (SetClient. nil) {:client (SetClient. nil)
@ -47,10 +47,18 @@
{:set (checker/set) {:set (checker/set)
:timeline (timeline/html)}) :timeline (timeline/html)})
; :generator (gen/mix [op-add op-read]) ; :generator (gen/mix [op-add op-read])
; :generator (->> (range) :generator (->> (range)
; (map (fn [x] {:type :invoke, :f :add, :value x}))) (map (fn [x] {:type :invoke, :f :add, :value x})))
:generator (gen/mix [op-read
(->> (range) (map (fn [x] {:type :invoke, :f :add, :value x})))])
:final-generator (gen/once op-read)}) :final-generator (gen/once op-read)})
(defn workload2
"Tests insertions and deletions"
[opts]
{:client (SetClient. nil)
:checker (checker/compose
{:set (checker/set-full {:linearizable? false})
:timeline (timeline/html)})
:generator (gen/mix [op-read
(->> (range) (map (fn [x] {:type :invoke, :f :add, :value x})))])})