testoscope 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +48 -22
- data/lib/testoscope/version.rb +1 -1
- data/lib/testoscope.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 209132be3c8b8b1c9c55b1d18e659941854a5e71
|
4
|
+
data.tar.gz: 284713148cbc5134fb98177be656dec87cb9c75f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d59faca20121c7eb16f5353b77436f46caf45abafa13c77214ba445bafd895353e7751abcb4f96adeb0a71b5dd1756f5abaeb011d7b2c7bd12e0dee39996510
|
7
|
+
data.tar.gz: 716502e6a0e723c4b63329da373df75785e350b89f8874810df3aa9d919e3ccaa9e694158068e5576a7227f14aa46b820dd4c00a7ef9dbd16e32b7d35d3c7237
|
data/.idea/workspace.xml
CHANGED
@@ -8,6 +8,8 @@
|
|
8
8
|
<change beforePath="" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
9
9
|
<change beforePath="" afterPath="$PROJECT_DIR$/.travis.yml" />
|
10
10
|
<change beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
|
11
|
+
<change beforePath="$PROJECT_DIR$/lib/testoscope.rb" afterPath="$PROJECT_DIR$/lib/testoscope.rb" />
|
12
|
+
<change beforePath="$PROJECT_DIR$/lib/testoscope/version.rb" afterPath="$PROJECT_DIR$/lib/testoscope/version.rb" />
|
11
13
|
</list>
|
12
14
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
13
15
|
<option name="TRACKING_ENABLED" value="true" />
|
@@ -28,22 +30,22 @@
|
|
28
30
|
</provider>
|
29
31
|
</entry>
|
30
32
|
</file>
|
31
|
-
<file leaf-file-name="testoscope.rb" pinned="false" current-in-tab="
|
33
|
+
<file leaf-file-name="testoscope.rb" pinned="false" current-in-tab="true">
|
32
34
|
<entry file="file://$PROJECT_DIR$/lib/testoscope.rb">
|
33
35
|
<provider selected="true" editor-type-id="text-editor">
|
34
|
-
<state relative-caret-position="
|
35
|
-
<caret line="
|
36
|
+
<state relative-caret-position="328">
|
37
|
+
<caret line="128" column="21" lean-forward="false" selection-start-line="128" selection-start-column="21" selection-end-line="128" selection-end-column="21" />
|
36
38
|
<folding />
|
37
39
|
</state>
|
38
40
|
</provider>
|
39
41
|
</entry>
|
40
42
|
</file>
|
41
|
-
<file leaf-file-name="README.md" pinned="false" current-in-tab="
|
43
|
+
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
|
42
44
|
<entry file="file://$PROJECT_DIR$/README.md">
|
43
45
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
44
46
|
<state split_layout="SPLIT">
|
45
|
-
<first_editor relative-caret-position="
|
46
|
-
<caret line="121" column="0" lean-forward="
|
47
|
+
<first_editor relative-caret-position="524">
|
48
|
+
<caret line="121" column="0" lean-forward="false" selection-start-line="121" selection-start-column="0" selection-end-line="121" selection-end-column="0" />
|
47
49
|
<folding />
|
48
50
|
</first_editor>
|
49
51
|
<second_editor />
|
@@ -51,6 +53,16 @@
|
|
51
53
|
</provider>
|
52
54
|
</entry>
|
53
55
|
</file>
|
56
|
+
<file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
|
57
|
+
<entry file="file://$PROJECT_DIR$/lib/testoscope/version.rb">
|
58
|
+
<provider selected="true" editor-type-id="text-editor">
|
59
|
+
<state relative-caret-position="15">
|
60
|
+
<caret line="1" column="18" lean-forward="false" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
61
|
+
<folding />
|
62
|
+
</state>
|
63
|
+
</provider>
|
64
|
+
</entry>
|
65
|
+
</file>
|
54
66
|
<file leaf-file-name=".gitignore" pinned="false" current-in-tab="false">
|
55
67
|
<entry file="file://$PROJECT_DIR$/.gitignore">
|
56
68
|
<provider selected="true" editor-type-id="text-editor">
|
@@ -69,10 +81,11 @@
|
|
69
81
|
<component name="IdeDocumentHistory">
|
70
82
|
<option name="CHANGED_PATHS">
|
71
83
|
<list>
|
72
|
-
<option value="$PROJECT_DIR$/lib/testoscope.rb" />
|
73
84
|
<option value="$PROJECT_DIR$/.gitignore" />
|
74
85
|
<option value="$PROJECT_DIR$/testoscope.gemspec" />
|
75
86
|
<option value="$PROJECT_DIR$/README.md" />
|
87
|
+
<option value="$PROJECT_DIR$/lib/testoscope/version.rb" />
|
88
|
+
<option value="$PROJECT_DIR$/lib/testoscope.rb" />
|
76
89
|
</list>
|
77
90
|
</option>
|
78
91
|
</component>
|
@@ -116,6 +129,12 @@
|
|
116
129
|
<item name="testoscope" type="462c0819:PsiDirectoryNode" />
|
117
130
|
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
118
131
|
</path>
|
132
|
+
<path>
|
133
|
+
<item name="testoscope" type="b2602c69:ProjectViewProjectNode" />
|
134
|
+
<item name="testoscope" type="462c0819:PsiDirectoryNode" />
|
135
|
+
<item name="lib" type="462c0819:PsiDirectoryNode" />
|
136
|
+
<item name="testoscope" type="462c0819:PsiDirectoryNode" />
|
137
|
+
</path>
|
119
138
|
</expand>
|
120
139
|
<select />
|
121
140
|
</subPane>
|
@@ -158,7 +177,7 @@
|
|
158
177
|
<option name="number" value="Default" />
|
159
178
|
<option name="presentableId" value="Default" />
|
160
179
|
<updated>1521465490978</updated>
|
161
|
-
<workItem from="1521465492548" duration="
|
180
|
+
<workItem from="1521465492548" duration="15672000" />
|
162
181
|
</task>
|
163
182
|
<task id="LOCAL-00001" summary="initial commit">
|
164
183
|
<created>1521545104500</created>
|
@@ -185,21 +204,20 @@
|
|
185
204
|
<servers />
|
186
205
|
</component>
|
187
206
|
<component name="TimeTrackingManager">
|
188
|
-
<option name="totallyTimeSpent" value="
|
207
|
+
<option name="totallyTimeSpent" value="15672000" />
|
189
208
|
</component>
|
190
209
|
<component name="ToolWindowManager">
|
191
210
|
<frame x="0" y="0" width="1440" height="900" extended-state="0" />
|
192
|
-
<editor active="true" />
|
193
211
|
<layout>
|
194
212
|
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.14663805" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
195
213
|
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
196
214
|
<window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
197
215
|
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
198
216
|
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
199
|
-
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="
|
217
|
+
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32889965" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
200
218
|
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
201
219
|
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
202
|
-
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="
|
220
|
+
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32889965" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
203
221
|
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
204
222
|
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
205
223
|
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
@@ -230,14 +248,6 @@
|
|
230
248
|
<watches-manager />
|
231
249
|
</component>
|
232
250
|
<component name="editorHistoryManager">
|
233
|
-
<entry file="file://$PROJECT_DIR$/lib/testoscope.rb">
|
234
|
-
<provider selected="true" editor-type-id="text-editor">
|
235
|
-
<state relative-caret-position="120">
|
236
|
-
<caret line="8" column="0" lean-forward="false" selection-start-line="8" selection-start-column="0" selection-end-line="13" selection-end-column="24" />
|
237
|
-
<folding />
|
238
|
-
</state>
|
239
|
-
</provider>
|
240
|
-
</entry>
|
241
251
|
<entry file="file://$PROJECT_DIR$/.gitignore">
|
242
252
|
<provider selected="true" editor-type-id="text-editor">
|
243
253
|
<state relative-caret-position="0">
|
@@ -257,13 +267,29 @@
|
|
257
267
|
<entry file="file://$PROJECT_DIR$/README.md">
|
258
268
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
259
269
|
<state split_layout="SPLIT">
|
260
|
-
<first_editor relative-caret-position="
|
261
|
-
<caret line="121" column="0" lean-forward="
|
270
|
+
<first_editor relative-caret-position="524">
|
271
|
+
<caret line="121" column="0" lean-forward="false" selection-start-line="121" selection-start-column="0" selection-end-line="121" selection-end-column="0" />
|
262
272
|
<folding />
|
263
273
|
</first_editor>
|
264
274
|
<second_editor />
|
265
275
|
</state>
|
266
276
|
</provider>
|
267
277
|
</entry>
|
278
|
+
<entry file="file://$PROJECT_DIR$/lib/testoscope/version.rb">
|
279
|
+
<provider selected="true" editor-type-id="text-editor">
|
280
|
+
<state relative-caret-position="15">
|
281
|
+
<caret line="1" column="18" lean-forward="false" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
282
|
+
<folding />
|
283
|
+
</state>
|
284
|
+
</provider>
|
285
|
+
</entry>
|
286
|
+
<entry file="file://$PROJECT_DIR$/lib/testoscope.rb">
|
287
|
+
<provider selected="true" editor-type-id="text-editor">
|
288
|
+
<state relative-caret-position="328">
|
289
|
+
<caret line="128" column="21" lean-forward="false" selection-start-line="128" selection-start-column="21" selection-end-line="128" selection-end-column="21" />
|
290
|
+
<folding />
|
291
|
+
</state>
|
292
|
+
</provider>
|
293
|
+
</entry>
|
268
294
|
</component>
|
269
295
|
</project>
|
data/lib/testoscope/version.rb
CHANGED
data/lib/testoscope.rb
CHANGED
@@ -11,6 +11,7 @@ module Testoscope
|
|
11
11
|
self.unintened_key_words = ['Seq Scan', 'One-Time Filter']
|
12
12
|
self.raise_when_unintended = false
|
13
13
|
self.analyze = true
|
14
|
+
self.pp_class = "::ActiveRecord::ConnectionAdapters::#{::ActiveRecord::Base.connection.adapter_name}::ExplainPrettyPrinter".constantize
|
14
15
|
self.tables = :all
|
15
16
|
end
|
16
17
|
end
|
@@ -123,9 +124,9 @@ module Testoscope
|
|
123
124
|
|
124
125
|
module AdapterUpgrade
|
125
126
|
def exec_query(sql, name = "SQL", binds = [], prepare: false)
|
126
|
-
|
127
|
-
|
128
|
-
|
127
|
+
Testoscope.analyze(sql) {
|
128
|
+
explain = super( 'EXPLAIN ' + sql, "EXPLAIN", binds, prepare: false)
|
129
|
+
pp_class.method(:pp).arity.abs == 1 ? pp_class.new.pp( explain ) : pp_class.new.pp( explain, 0 )
|
129
130
|
}
|
130
131
|
super( sql, name, binds, prepare: prepare )
|
131
132
|
end
|