제니퍼 APM 주요 SQL

조회 775 · 댓글 0
탐크루즈작성자2022년 1월 10일
1. 시간당 방문자수

select a.log_hh, a.visit_hour, b.visit_hour, c.visit_hour

from
(select agent_id, log_hh, avg(visit_hour) as visit_hour
from s_perf_x
where log_dt like '201311%'
and agent_id in ('AP1')
group by agent_id, log_hh ) a,
(select agent_id, log_hh, avg(visit_hour) as visit_hour
from s_perf_x
where log_dt like '201311%'
and agent_id in ('AP2')
group by agent_id, log_hh ) b,
(select agent_id, log_hh, avg(visit_hour) as visit_hour
from s_perf_x
where log_dt like '201311%'
and agent_id in ('AP3')
group by agent_id, log_hh ) c
where a.log_hh = b.log_hh
and a.log_hh = c.log_hh;


2. 시간당 전체

select a.log_hh, a.hit, a.arrival_rate, a.active_service

, b.hit, b.arrival_rate, b.active_service
, c.hit, c.arrival_rate, c.active_service
from
(select agent_id, log_hh, avg(visit_hour) as visit_hour, sum(hit) as hit
, avg(arrival_rate) as arrival_rate
, avg(active_service) as active_service
from s_perf_x
where log_dt like '201311%'
and agent_id in ('AP1')
group by agent_id, log_hh ) a,
(select agent_id, log_hh, avg(visit_hour) as visit_hour, sum(hit) as hit
, avg(arrival_rate) as arrival_rate
, avg(active_service) as active_service
from s_perf_x
where log_dt like '201311%'
and agent_id in ('AP2')
group by agent_id, log_hh ) b,
(select agent_id, log_hh, avg(visit_hour) as visit_hour, sum(hit) as hit
, avg(arrival_rate) as arrival_rate
, avg(active_service) as active_service
from s_perf_x
where log_dt like '201311%'
and agent_id in ('AP3')
group by agent_id, log_hh ) c
where a.log_hh = b.log_hh
and a.log_hh = c.log_hh;

로그인 후 답글을 남길 수 있습니다.