nose 0.1.0pre → 0.1.0pre1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,159 @@
1
+ # frozen_string_literal: true
2
+
3
+ NoSE::Workload.new do
4
+ Model 'rubis'
5
+
6
+ # Define queries and their relative weights, weights taken from below
7
+ # http://rubis.ow2.org/results/SB-BMP/Bidding/JBoss-SB-BMP-Bi-1500/perf.html#run_stat
8
+ # http://rubis.ow2.org/results/SB-BMP/Browsing/JBoss-SB-BMP-Br-1500/perf.html#run_stat
9
+ DefaultMix :browsing
10
+
11
+ Group 'BrowseCategories', browsing: 4.44,
12
+ bidding: 7.65,
13
+ write_medium: 7.65,
14
+ write_heavy: 7.65 do
15
+ Q 'SELECT users.nickname, users.password FROM users WHERE users.id = ? -- 1'
16
+ # XXX Must have at least one equality predicate
17
+ Q 'SELECT categories.id, categories.name FROM categories WHERE ' \
18
+ 'categories.dummy = 1 -- 2'
19
+ end
20
+
21
+ Group 'ViewBidHistory', browsing: 2.38,
22
+ bidding: 1.54,
23
+ write_medium: 1.54,
24
+ write_heavy: 1.54 do
25
+ Q 'SELECT items.name FROM items WHERE items.id = ? -- 3'
26
+ Q 'SELECT users.id, users.nickname, bids.id, item.id, bids.qty, ' \
27
+ 'bids.bid, bids.date FROM users.bids.item WHERE item.id = ? ' \
28
+ 'ORDER BY bids.date -- 4'
29
+ end
30
+
31
+ Group 'ViewItem', browsing: 22.95,
32
+ bidding: 14.17,
33
+ write_medium: 14.17,
34
+ write_heavy: 14.17 do
35
+ Q 'SELECT items.* FROM items WHERE items.id = ? -- 5'
36
+ Q 'SELECT bids.* FROM items.bids WHERE items.id = ? -- 6'
37
+ end
38
+
39
+ Group 'SearchItemsByCategory', browsing: 27.77,
40
+ bidding: 15.94,
41
+ write_medium: 15.94,
42
+ write_heavy: 15.94 do
43
+ Q 'SELECT items.id, items.name, items.initial_price, items.max_bid, ' \
44
+ 'items.nb_of_bids, items.end_date FROM items.category WHERE ' \
45
+ 'category.id = ? AND items.end_date >= ? LIMIT 25 -- 7'
46
+ end
47
+
48
+ Group 'ViewUserInfo', browsing: 4.41,
49
+ bidding: 2.48,
50
+ write_medium: 2.48,
51
+ write_heavy: 2.48 do
52
+ # XXX Not including region name below
53
+ Q 'SELECT users.* FROM users WHERE users.id = ? -- 8'
54
+ Q 'SELECT comments.id, comments.rating, comments.date, comments.comment ' \
55
+ 'FROM comments.to_user WHERE to_user.id = ? -- 9'
56
+ end
57
+
58
+ Group 'RegisterItem', bidding: 0.53,
59
+ write_medium: 0.53 * 10,
60
+ write_heavy: 0.53 * 100 do
61
+ Q 'INSERT INTO items SET id=?, name=?, description=?, initial_price=?, ' \
62
+ 'quantity=?, reserve_price=?, buy_now=?, nb_of_bids=0, max_bid=0, ' \
63
+ 'start_date=?, end_date=? AND CONNECT TO category(?), seller(?) -- 10'
64
+ end
65
+
66
+ Group 'RegisterUser', bidding: 1.07,
67
+ write_medium: 1.07 * 10,
68
+ write_heavy: 1.07 * 100 do
69
+ Q 'INSERT INTO users SET id=?, firstname=?, lastname=?, nickname=?, ' \
70
+ 'password=?, email=?, rating=0, balance=0, creation_date=? ' \
71
+ 'AND CONNECT TO region(?) -- 11'
72
+ end
73
+
74
+ Group 'BuyNow', bidding: 1.16,
75
+ write_medium: 1.16,
76
+ write_heavy: 1.16 do
77
+ Q 'SELECT users.nickname FROM users WHERE users.id=? -- 12'
78
+ Q 'SELECT items.* FROM items WHERE items.id=? -- 13'
79
+ end
80
+
81
+ Group 'StoreBuyNow', bidding: 1.10,
82
+ write_medium: 1.10 * 10,
83
+ write_heavy: 1.10 * 100 do
84
+ Q 'SELECT items.quantity, items.nb_of_bids, items.end_date FROM items ' \
85
+ 'WHERE items.id=? -- 14'
86
+ Q 'UPDATE items SET quantity=?, nb_of_bids=?, end_date=? WHERE items.id=? -- 15'
87
+ Q 'INSERT INTO buynow SET id=?, qty=?, date=? ' \
88
+ 'AND CONNECT TO item(?), buyer(?) -- 16'
89
+ end
90
+
91
+ Group 'PutBid', bidding: 5.40,
92
+ write_medium: 5.40,
93
+ write_heavy: 5.40 do
94
+ Q 'SELECT users.nickname, users.password FROM users WHERE users.id=? -- 17'
95
+ Q 'SELECT items.* FROM items WHERE items.id=? -- 18'
96
+ Q 'SELECT bids.qty, bids.date FROM bids.item WHERE item.id=? ' \
97
+ 'ORDER BY bids.bid LIMIT 2 -- 19'
98
+ end
99
+
100
+ Group 'StoreBid', bidding: 3.74,
101
+ write_medium: 3.74 * 10,
102
+ write_heavy: 3.74 * 100 do
103
+ Q 'INSERT INTO bids SET id=?, qty=?, bid=?, date=? ' \
104
+ 'AND CONNECT TO item(?), user(?) -- 20'
105
+ Q 'SELECT items.nb_of_bids, items.max_bid FROM items WHERE items.id=? -- 21'
106
+ Q 'UPDATE items SET nb_of_bids=?, max_bid=? WHERE items.id=? -- 22'
107
+ end
108
+
109
+ Group 'PutComment', bidding: 0.46,
110
+ write_medium: 0.46,
111
+ write_heavy: 0.46 do
112
+ Q 'SELECT users.nickname, users.password FROM users WHERE users.id=? -- 23'
113
+ Q 'SELECT items.* FROM items WHERE items.id=? -- 24'
114
+ Q 'SELECT users.* FROM users WHERE users.id=? -- 25'
115
+ end
116
+
117
+ Group 'StoreComment', bidding: 0.45,
118
+ write_medium: 0.45 * 10,
119
+ write_heavy: 0.45 * 100 do
120
+ Q 'SELECT users.rating FROM users WHERE users.id=? -- 26'
121
+ Q 'UPDATE users SET rating=? WHERE users.id=? -- 27'
122
+ Q 'INSERT INTO comments SET id=?, rating=?, date=?, comment=? ' \
123
+ 'AND CONNECT TO to_user(?), from_user(?), item(?) -- 28'
124
+ end
125
+
126
+ Group 'AboutMe', bidding: 1.71,
127
+ write_medium: 1.71,
128
+ write_heavy: 1.71 do
129
+ Q 'SELECT users.* FROM users WHERE users.id=? -- 29'
130
+ Q 'SELECT comments_received.* FROM users.comments_received ' \
131
+ 'WHERE users.id = ? -- 30'
132
+ Q 'SELECT from_user.nickname FROM comments.from_user WHERE comments.id = ? -- 31'
133
+ Q 'SELECT bought_now.*, items.* FROM items.bought_now.buyer ' \
134
+ 'WHERE buyer.id = ? AND bought_now.date>=? -- 32'
135
+ Q 'SELECT items.* FROM items.seller WHERE seller.id=? AND ' \
136
+ 'items.end_date >=? -- 33'
137
+ Q 'SELECT items.* FROM items.bids.user WHERE user.id=? AND ' \
138
+ 'items.end_date>=? -- 34'
139
+ end
140
+
141
+ Group 'SearchItemsByRegion', browsing: 8.26,
142
+ bidding: 6.34,
143
+ write_medium: 6.34,
144
+ write_heavy: 6.34 do
145
+ Q 'SELECT items.id, items.name, items.initial_price, items.max_bid, ' \
146
+ 'items.nb_of_bids, items.end_date FROM ' \
147
+ 'items.seller WHERE seller.region.id = ? AND items.category.id = ? ' \
148
+ 'AND items.end_date >= ? LIMIT 25 -- 35'
149
+ end
150
+
151
+ Group 'BrowseRegions', browsing: 3.21,
152
+ bidding: 5.39,
153
+ write_medium: 5.39,
154
+ write_heavy: 5.39 do
155
+ # XXX Must have at least one equality predicate
156
+ Q 'SELECT regions.id, regions.name FROM regions ' \
157
+ 'WHERE regions.dummy = 1 -- 36'
158
+ end
159
+ end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ NoSE::Workload.new do
4
+ Model 'rubis'
5
+
6
+ # Define queries and their relative weights
7
+
8
+ Q 'SELECT comments.date, comments.comment FROM comments.item ' \
9
+ 'WHERE item.id = ? ORDER BY comments.date'
10
+ # 1. SELECT item_id as E_item, date as O_date, from_user_id, date, comment
11
+ # FROM comments;
12
+ # I2227598752
13
+
14
+ Q 'SELECT users.id, users.nickname, users.rating FROM users.region ' \
15
+ 'WHERE region.id = ? ORDER BY users.rating LIMIT 50'
16
+ # 2. SELECT region as E_region, rating as O_rating, id, nickname, rating
17
+ # FROM users;
18
+ # I1083340549
19
+
20
+ Q 'SELECT items.id, items.name, items.description, items.max_bid ' \
21
+ 'FROM items.seller.region WHERE region.id = ? LIMIT 50'
22
+ # 3. SELECT region as E_region, items.id, name, description, max_bid FROM
23
+ # items join users on items.seller=users.id WHERE items.seller.region;
24
+ # I4186334592
25
+
26
+ Q 'SELECT comments.date, comments.comment FROM ' \
27
+ 'comments.item.seller.region WHERE item.quantity = ? AND region.id = ? ' \
28
+ 'LIMIT 50'
29
+ # 4. SELECT category AS E_category, region as E_region, from_user_id, date,
30
+ # comment FROM comments join items on comments.item_id=items.id join
31
+ # users on items.seller=users.id;
32
+ # I3254083673
33
+
34
+ Q 'SELECT bids.bid, bids.date FROM bids.item.seller.region WHERE ' \
35
+ 'region.id = ? AND item.quantity = ? AND ' \
36
+ 'item.end_date < "2015-06-11T14:00:00-04:00"'
37
+ # 5. SELECT region as E_region, category as E_category,
38
+ # end_date as O_end_date, bids.id as O_id, bid, date FROM bids join
39
+ # items on bids.item_id=items.id join users on items.seller=users.id
40
+ # I1184534160
41
+
42
+ Q 'SELECT comments.comment, comments.date FROM comments.item.seller ' \
43
+ 'WHERE seller.id = ?'
44
+ # 6. SELECT seller AS E_seller, comments.id AS O_id, from_user_id, comment,
45
+ # date FROM comments join items on comments.item_id=items.id;
46
+ # I638854407
47
+
48
+ Q 'SELECT items.id, items.name FROM items.category WHERE category.id = ? ' \
49
+ 'LIMIT 1000'
50
+ # 7. SELECT category as E_category, id, name FROM items;
51
+ # I3358488952
52
+
53
+ Q 'SELECT comments.comment FROM comments.item.category ' \
54
+ 'WHERE category.id = ? ORDER BY comments.date LIMIT 100'
55
+ # 8. SELECT category AS E_category, date AS O_date, comment FROM comments
56
+ # join items ON comments.item_id=items.id;
57
+ # I127205473
58
+
59
+ # RegisterItem
60
+ Q 'INSERT INTO items SET id=?, name=?, description=?, initial_price=?, ' \
61
+ 'quantity=?, reserve_price=?, buy_now=?, nb_of_bids=0, max_bid=0, ' \
62
+ 'start_date=?, end_date=?'
63
+ Q 'CONNECT items(?) TO category(?)'
64
+ Q 'CONNECT items(?) TO seller(?)'
65
+
66
+ # RegisterUser
67
+ Q 'INSERT INTO users SET id=?, firstname=?, lastname=?, nickname=?, ' \
68
+ 'password=?, email=?, rating=0, balance=0, creation_date=?'
69
+ Q 'CONNECT users(?) TO region(?)'
70
+
71
+ # StoreBid
72
+ Q 'INSERT INTO bids SET id=?, qty=?, bid=?, date=?'
73
+ Q 'CONNECT bids(?) TO item(?)'
74
+ Q 'CONNECT bids(?) TO user(?)'
75
+ Q 'SELECT items.nb_of_bids FROM items WHERE items.id=?'
76
+ Q 'UPDATE items SET nb_of_bids=? WHERE items.id=?'
77
+
78
+ # StoreComment
79
+ Q 'UPDATE users SET rating=? WHERE users.id=?'
80
+ Q 'INSERT INTO comments SET id=?, rating=?, date=?, comment=?'
81
+ # Q 'CONNECT comments(?) TO to_user(?)'
82
+ Q 'CONNECT comments(?) TO from_user(?)'
83
+ Q 'CONNECT comments(?) TO item(?)'
84
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nose
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0pre
4
+ version: 0.1.0pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Mior
@@ -672,7 +672,20 @@ files:
672
672
  - lib/nose/timing.rb
673
673
  - lib/nose/util.rb
674
674
  - lib/nose/workload.rb
675
+ - models/eac.rb
676
+ - models/ebay.rb
677
+ - models/rubis.rb
678
+ - plans/ebay.rb
679
+ - plans/rubis_baseline.rb
680
+ - plans/rubis_expert.rb
681
+ - schemas/ebay.rb
682
+ - schemas/rubis_baseline.rb
683
+ - schemas/rubis_expert.rb
675
684
  - templates/workload.erb
685
+ - workloads/eac.rb
686
+ - workloads/ebay.rb
687
+ - workloads/rubis.rb
688
+ - workloads/rubis_synthetic.rb
676
689
  homepage: https://michael.mior.ca/projects/NoSE/
677
690
  licenses:
678
691
  - GPL-3.0