I am sure there are much better approaches to doing this but I wanted to share it anyway. I also know there is logging built in but I wanted an easier way to make this possible.
What if I wanted to track the amount of times an appcenter application is executed? Or what if I wanted to track overlap and concurrency of apps executed? What if I wanted to run analytics on how long an app runs and do analytics on Aster. You will need to be running on the latest edition of AppCenter, this may not work on the initial release.
Here is a solution to make that possible:
1. Build a Table:
CREATE FACT TABLE public.appcenter_log (
id varchar(1000) NULL,
appdate timestamp NULL,
notes varchar(1000) NULL
DISTRIBUTE BY HASH (id)
This is the table that will hold the state of AppCenter App runs.
2. Then add two lines of code to your app:
--ADD THIS LINE IN TO GET THE STARTING TIME OF THE APP:
insert into public.appcenter_log values('%uniqueId%'::VARCHAR, current_timestamp, 'THIS IS MY APPNAME', 'APP START');
--APPCODE GOES HERE:
DROP VIEW IF EXISTS public.vw_retail_sub_affinity;
--PRODUCT SUBTYPE CD AFFINITY
FROM cfilter (
ON (SELECT 1)
PARTITION BY 1
--ADD THIS LINE IN TO GET THE ENDING TIME OF THE APP:
insert into public.appcenter_log values('%uniqueId%'::VARCHAR, current_timestamp, 'THIS IS MY APPNAME', 'APP END');