Skip to content

Commit

Permalink
#000 | Add some useful queries and add thread-name to log pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
himeshr committed Oct 13, 2023
1 parent 88f1331 commit 636187d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/log4j.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<param name="MaxFileSize" value="5000KB"/>
<param name="MaxBackupIndex" value="10"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
<param name="ConversionPattern" value="%d %-5p %t [%c{3}] %m%n"/>
</layout>
</appender>

<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
<param name="ConversionPattern" value="%d %-5p %t [%c{3}] %m%n"/>
</layout>
</appender>

Expand Down
30 changes: 29 additions & 1 deletion src/main/resources/sql/usefulQueries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,32 @@ BEGIN
execute 'delete from table_metadata where schema_name = ''' || in_impl_schema || ''';';
return true;
END
$$;
$$;

-- List all waiting triggers for ETL , in ascending order of next trigger
select
qt.trigger_state,
qt.trigger_type,
qjd.job_name,
qjd.sched_name,
qjd.job_group,
qjd.description,
qt.next_fire_time
from public.qrtz_triggers qt
join public.qrtz_job_details qjd
on qt.sched_name = qjd.sched_name
and qt.job_name = qjd.job_name
and qt.job_group = qjd.job_group
order by qt.next_fire_time asc;

-- List currently running ETL job
select qft.state,
qt.trigger_state,
qt.trigger_type,
qjd.job_name,
qjd.sched_name,
qjd.job_group,
qjd.description
from qrtz_fired_triggers qft
join qrtz_triggers qt on qft.job_name = qt.job_name
join qrtz_job_details qjd on qt.sched_name = qjd.sched_name and qt.job_name = qjd.job_name and qt.job_group = qjd.job_group;

0 comments on commit 636187d

Please sign in to comment.