Show requests from other apps
This commit is contained in:
parent
69b6ab8b1c
commit
c320e147e6
@ -602,6 +602,21 @@ wwv_flow_api.create_jet_chart_series(
|
|||||||
,p_assigned_to_y2=>'off'
|
,p_assigned_to_y2=>'off'
|
||||||
,p_items_label_rendered=>false
|
,p_items_label_rendered=>false
|
||||||
);
|
);
|
||||||
|
wwv_flow_api.create_jet_chart_series(
|
||||||
|
p_id=>wwv_flow_api.id(14219367382378941)
|
||||||
|
,p_chart_id=>wwv_flow_api.id(11884191829358759)
|
||||||
|
,p_seq=>40
|
||||||
|
,p_name=>'Others'
|
||||||
|
,p_location=>'REGION_SOURCE'
|
||||||
|
,p_items_value_column_name=>'COUNT_OTHERS'
|
||||||
|
,p_items_label_column_name=>'CHART_LABEL'
|
||||||
|
,p_line_style=>'solid'
|
||||||
|
,p_line_type=>'auto'
|
||||||
|
,p_marker_rendered=>'auto'
|
||||||
|
,p_marker_shape=>'circle'
|
||||||
|
,p_assigned_to_y2=>'off'
|
||||||
|
,p_items_label_rendered=>false
|
||||||
|
);
|
||||||
wwv_flow_api.create_jet_chart_axis(
|
wwv_flow_api.create_jet_chart_axis(
|
||||||
p_id=>wwv_flow_api.id(11884682966358760)
|
p_id=>wwv_flow_api.id(11884682966358760)
|
||||||
,p_chart_id=>wwv_flow_api.id(11884191829358759)
|
,p_chart_id=>wwv_flow_api.id(11884191829358759)
|
||||||
|
|||||||
@ -1,17 +1,19 @@
|
|||||||
CREATE OR REPLACE VIEW sessions_chart AS
|
CREATE OR REPLACE VIEW sessions_chart AS
|
||||||
WITH x AS (
|
WITH x AS (
|
||||||
SELECT
|
SELECT
|
||||||
TRUNC(app.get_date_item('G_TODAY')) AS today,
|
app.get_app_id() AS app_id,
|
||||||
app.get_app_id() AS app_id,
|
app.get_item('$USER_ID') AS user_id,
|
||||||
10 AS buckets
|
app.get_date_item('G_TODAY') AS today,
|
||||||
|
10 AS buckets
|
||||||
FROM users u
|
FROM users u
|
||||||
WHERE u.user_id = app.get_user_id()
|
WHERE u.user_id = app.get_user_id()
|
||||||
),
|
),
|
||||||
z AS (
|
z AS (
|
||||||
SELECT
|
SELECT
|
||||||
x.app_id,
|
x.app_id,
|
||||||
x.buckets,
|
x.user_id,
|
||||||
x.today,
|
x.today,
|
||||||
|
x.buckets,
|
||||||
--
|
--
|
||||||
LEVEL AS bucket_id,
|
LEVEL AS bucket_id,
|
||||||
TRUNC(SYSDATE) + NUMTODSINTERVAL((LEVEL - 1) * x.buckets, 'MINUTE') AS start_at,
|
TRUNC(SYSDATE) + NUMTODSINTERVAL((LEVEL - 1) * x.buckets, 'MINUTE') AS start_at,
|
||||||
@ -25,12 +27,20 @@ SELECT
|
|||||||
NULLIF(COUNT(DISTINCT l.session_id), 0) AS count_sessions,
|
NULLIF(COUNT(DISTINCT l.session_id), 0) AS count_sessions,
|
||||||
NULLIF(COUNT(DISTINCT l.user_id), 0) AS count_users,
|
NULLIF(COUNT(DISTINCT l.user_id), 0) AS count_users,
|
||||||
NULLIF(COUNT(DISTINCT l.page_id), 0) AS count_pages,
|
NULLIF(COUNT(DISTINCT l.page_id), 0) AS count_pages,
|
||||||
NULLIF(SUM(CASE WHEN l.flag = 'P' THEN 1 ELSE 0 END), 0) AS count_requests -- app.flag_request
|
NULLIF(SUM(CASE WHEN l.flag = 'P' THEN 1 ELSE 0 END), 0) AS count_requests, -- app.flag_request
|
||||||
|
NULLIF(SUM(CASE WHEN o.flag = 'P' THEN 1 ELSE 0 END), 0) AS count_others
|
||||||
FROM z
|
FROM z
|
||||||
LEFT JOIN logs l
|
LEFT JOIN logs l
|
||||||
ON l.created_at >= z.today
|
ON l.created_at >= z.today
|
||||||
AND l.created_at < z.today + 1
|
AND l.created_at < z.today + 1
|
||||||
|
AND (l.user_id = z.user_id OR z.user_id IS NULL)
|
||||||
AND l.app_id = z.app_id
|
AND l.app_id = z.app_id
|
||||||
AND z.bucket_id = app.get_time_bucket(l.created_at, z.buckets)
|
AND z.bucket_id = app.get_time_bucket(l.created_at, z.buckets)
|
||||||
|
LEFT JOIN logs o
|
||||||
|
ON o.created_at >= z.today
|
||||||
|
AND o.created_at < z.today + 1
|
||||||
|
AND o.app_id != z.app_id
|
||||||
|
AND z.bucket_id = app.get_time_bucket(o.created_at, z.buckets)
|
||||||
|
AND o.user_id = z.user_id
|
||||||
GROUP BY z.bucket_id, TO_CHAR(z.start_at, 'HH24:MI');
|
GROUP BY z.bucket_id, TO_CHAR(z.start_at, 'HH24:MI');
|
||||||
|
|
||||||
|
|||||||
@ -8,8 +8,8 @@ WITH s AS (
|
|||||||
AND (s.session_id = app.get_item('$SESSION_ID') OR app.get_item('$SESSION_ID') IS NULL)
|
AND (s.session_id = app.get_item('$SESSION_ID') OR app.get_item('$SESSION_ID') IS NULL)
|
||||||
AND (s.user_id = app.get_item('$USER_ID') OR app.get_item('$USER_ID') IS NULL)
|
AND (s.user_id = app.get_item('$USER_ID') OR app.get_item('$USER_ID') IS NULL)
|
||||||
--
|
--
|
||||||
AND s.created_at >= COALESCE(app.get_date_item('$TODAY'), TRUNC(SYSDATE))
|
AND s.created_at >= app.get_date_item('G_TODAY')
|
||||||
AND s.created_at < COALESCE(app.get_date_item('$TODAY'), TRUNC(SYSDATE)) + 1
|
AND s.created_at < app.get_date_item('G_TODAY') + 1
|
||||||
),
|
),
|
||||||
l AS (
|
l AS (
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user