activeinsights 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/active_insights/requests_controller.rb +1 -1
- data/app/helpers/active_insights/application_helper.rb +1 -1
- data/app/models/active_insights/request.rb +10 -4
- data/app/views/active_insights/requests/index.html.erb +1 -1
- data/lib/active_insights/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 357a2bfdbba595c8b40f5a63b2417d49bc6f4288c688e0d75ab77ba378cd078e
|
4
|
+
data.tar.gz: 52e2ad59d758b76ad46aa01cf592a3365dfe3baa407556196acbc027cbec121a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc8e3e23c6d340f047392bf9f21cd8e1bc1b255d9d072e7f30f4b2494d639522e3f1276021461ff87649c48bc0c61854ba234422ad2e508e0efbced367a28ab0
|
7
|
+
data.tar.gz: 1f184e727faf3f5a50ecc017158ee97058b5de3dacb4d8e0b8d3ba9d4725f62f245a4220d47a9221fb6dbfcbe700943c92f213ca4c58e2ef15586f22238d60b0
|
@@ -4,10 +4,12 @@ module ActiveInsights
|
|
4
4
|
class Request < ::ActiveInsights::Record
|
5
5
|
scope :with_durations, lambda {
|
6
6
|
case connection.adapter_name
|
7
|
-
when "SQLite"
|
8
|
-
select("
|
7
|
+
when "SQLite"
|
8
|
+
select("JSON_GROUP_ARRAY(duration) AS durations")
|
9
|
+
when "Mysql2", "Mysql2Spatial", "Mysql2Rgeo", "Trilogy"
|
10
|
+
select("JSON_ARRAYAGG(duration) AS durations")
|
9
11
|
when "PostgreSQL"
|
10
|
-
select("
|
12
|
+
select("JSON_AGG(duration) AS durations")
|
11
13
|
end
|
12
14
|
}
|
13
15
|
scope :minute_by_minute, lambda {
|
@@ -42,7 +44,11 @@ module ActiveInsights
|
|
42
44
|
def parsed_durations
|
43
45
|
return unless respond_to?(:durations)
|
44
46
|
|
45
|
-
@parsed_durations ||=
|
47
|
+
@parsed_durations ||=
|
48
|
+
if durations.is_a?(Array) then durations
|
49
|
+
else
|
50
|
+
JSON.parse(durations)
|
51
|
+
end.sort
|
46
52
|
end
|
47
53
|
|
48
54
|
def pretty_started_at
|
@@ -41,7 +41,7 @@
|
|
41
41
|
</tr>
|
42
42
|
</thead>
|
43
43
|
<tbody>
|
44
|
-
<% @requests.
|
44
|
+
<% @requests.each do |model| %>
|
45
45
|
<tr>
|
46
46
|
<td><%= link_to model.formatted_controller, controller_p_values_path(@date.first.to_date, model.formatted_controller) %></td>
|
47
47
|
<td><%= per_minute(model.parsed_durations.size, (@date.last - @date.first).seconds) %></td>
|