evt-message_store-postgres-database 0.4.1.0 → 0.5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/database/functions/get-stream-summary.sql +20 -12
- data/database/functions/get-type-summary.sql +20 -12
- data/database/print-type-summary.sh +8 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c588c659a4212dc17462524446f968ccddf10998e8ac7d3c4a6ed0df4f76aba7
|
4
|
+
data.tar.gz: b1d06c04be9d5098f76084b6f2bd676fdc91888feadc03d23d26e76d59ace978
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc24c1182bf2c4db4c9b0da6b9011a33f3592307d53c8c7eec1a89759f6d41dbf028bf7b301d124bd1e3dc64787e35de008ede6c82c3ddd51ba63aca6e65176
|
7
|
+
data.tar.gz: 5292fc4bbfc8ccdaa5578f146dfcf2f46ce0b75d93021f8df88528878ac1821995affba56900323df1ab12501f6976ba922ed8202f295db170728ffd52397bfb
|
@@ -11,23 +11,31 @@ DECLARE
|
|
11
11
|
command text;
|
12
12
|
BEGIN
|
13
13
|
command := '
|
14
|
-
|
15
|
-
|
16
|
-
message_count,
|
17
|
-
ROUND((SELECT (message_count::decimal / count(*)::decimal * 100.0) FROM messages)::decimal, 2) AS percent
|
18
|
-
FROM
|
19
|
-
(
|
14
|
+
WITH
|
15
|
+
stream_count AS (
|
20
16
|
SELECT
|
21
|
-
|
22
|
-
|
17
|
+
stream_name,
|
18
|
+
COUNT(id) AS message_count
|
23
19
|
FROM
|
24
|
-
messages
|
25
|
-
|
26
|
-
command := command || '
|
20
|
+
messages
|
27
21
|
GROUP BY
|
28
22
|
stream_name
|
29
|
-
)
|
23
|
+
),
|
30
24
|
|
25
|
+
total_count AS (
|
26
|
+
SELECT
|
27
|
+
COUNT(id)::decimal AS total_count
|
28
|
+
FROM
|
29
|
+
messages
|
30
|
+
)
|
31
|
+
|
32
|
+
SELECT
|
33
|
+
stream_name,
|
34
|
+
message_count,
|
35
|
+
ROUND((message_count / total_count)::decimal * 100, 2) AS percent
|
36
|
+
FROM
|
37
|
+
stream_count,
|
38
|
+
total_count';
|
31
39
|
|
32
40
|
IF _stream_name is not null THEN
|
33
41
|
_stream_name := '%' || _stream_name || '%';
|
@@ -11,23 +11,31 @@ DECLARE
|
|
11
11
|
command text;
|
12
12
|
BEGIN
|
13
13
|
command := '
|
14
|
-
|
15
|
-
|
16
|
-
message_count,
|
17
|
-
ROUND((SELECT (message_count::decimal / count(*)::decimal * 100.0) FROM messages)::decimal, 2) AS percent
|
18
|
-
FROM
|
19
|
-
(
|
14
|
+
WITH
|
15
|
+
type_count AS (
|
20
16
|
SELECT
|
21
|
-
|
22
|
-
|
17
|
+
type,
|
18
|
+
COUNT(id) AS message_count
|
23
19
|
FROM
|
24
|
-
messages
|
25
|
-
|
26
|
-
command := command || '
|
20
|
+
messages
|
27
21
|
GROUP BY
|
28
22
|
type
|
29
|
-
)
|
23
|
+
),
|
30
24
|
|
25
|
+
total_count AS (
|
26
|
+
SELECT
|
27
|
+
COUNT(id)::decimal AS total_count
|
28
|
+
FROM
|
29
|
+
messages
|
30
|
+
)
|
31
|
+
|
32
|
+
SELECT
|
33
|
+
type,
|
34
|
+
message_count,
|
35
|
+
ROUND((message_count / total_count)::decimal * 100, 2) AS percent
|
36
|
+
FROM
|
37
|
+
type_count,
|
38
|
+
total_count';
|
31
39
|
|
32
40
|
IF _type is not null THEN
|
33
41
|
_type := '%' || _type || '%';
|
@@ -22,12 +22,12 @@ else
|
|
22
22
|
fi
|
23
23
|
echo "Database name is: $database"
|
24
24
|
|
25
|
-
if [ -z ${
|
26
|
-
echo "(
|
27
|
-
|
25
|
+
if [ -z ${TYPE+x} ]; then
|
26
|
+
echo "(TYPE is not set)"
|
27
|
+
type=''
|
28
28
|
else
|
29
|
-
|
30
|
-
echo "Stream name is: $
|
29
|
+
type=$TYPE
|
30
|
+
echo "Stream name is: $TYPE"
|
31
31
|
fi
|
32
32
|
|
33
33
|
echo
|
@@ -35,10 +35,10 @@ echo "Type Summary"
|
|
35
35
|
echo "= = ="
|
36
36
|
echo
|
37
37
|
|
38
|
-
if [ -z $
|
38
|
+
if [ -z $type ]; then
|
39
39
|
psql $database -U $user -P pager=off -c "SELECT * FROM get_type_summary();"
|
40
40
|
psql $database -U $user -P pager=off -c "SELECT COUNT(*) AS total_count FROM messages;"
|
41
41
|
else
|
42
|
-
psql $database -U $user -P pager=off -c "SELECT * FROM get_type_summary('$
|
43
|
-
psql $database -U $user -P pager=off -c "SELECT COUNT(*) AS total_count FROM messages WHERE
|
42
|
+
psql $database -U $user -P pager=off -c "SELECT * FROM get_type_summary('$type');"
|
43
|
+
psql $database -U $user -P pager=off -c "SELECT COUNT(*) AS total_count FROM messages WHERE type LIKE '%$type%';"
|
44
44
|
fi
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-message_store-postgres-database
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: scripts
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: " "
|
14
14
|
email: opensource@eventide-project.org
|