latency updates (#290)

* latency updates

* decoder
This commit is contained in:
Austin 2024-12-09 12:37:16 -05:00 committed by GitHub
parent c1cd0d38f9
commit a06cc56a2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 85 deletions

View File

@ -3,9 +3,8 @@ run-name: dbt_run_abi_refresh
on:
workflow_dispatch:
schedule:
# Runs “At minute 0 past every 12th hour.” (see https://crontab.guru)
- cron: '0 */12 * * *'
branches:
- "main"
env:
DBT_PROFILES_DIR: ./
@ -42,7 +41,12 @@ jobs:
run: |
pip install -r requirements.txt
dbt deps
- name: Run DBT Jobs
- name: Update ABI Models
run: |
dbt run -m "arbitrum_models,tag:abis"
- name: Kick off decoded logs history, if there are new ABIs from users
run: |
dbt run-operation run_decoded_logs_history

View File

@ -1,45 +0,0 @@
name: dbt_run_scheduled_decoded_logs_history_user_abis
run-name: dbt_run_scheduled_decoded_logs_history_user_abis
on:
workflow_dispatch:
branches:
- "main"
env:
DBT_PROFILES_DIR: ./
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ secrets.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ vars.WAREHOUSE }}"
SCHEMA: "${{ vars.SCHEMA }}"
concurrency:
group: ${{ github.workflow }}
jobs:
run_dbt_jobs:
runs-on: ubuntu-latest
environment:
name: workflow_prod
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: install dependencies
run: |
pip install -r requirements.txt
dbt deps
- name: Kick off decoded logs history, if there are new ABIs from users
run: |
dbt run-operation run_decoded_logs_history

View File

@ -1,29 +0,0 @@
name: dbt_test_tasks
run-name: dbt_test_tasks
on:
workflow_dispatch:
branches:
- "main"
env:
DBT_PROFILES_DIR: ./
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ secrets.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ vars.WAREHOUSE }}"
SCHEMA: "${{ vars.SCHEMA }}"
concurrency:
group: ${{ github.workflow }}
jobs:
called_workflow_template:
uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_test_tasks.yml@AN-4374/upgrade-dbt-1.7
secrets: inherit

View File

@ -1,9 +1,8 @@
workflow_name,workflow_schedule
dbt_run_scheduled_non_realtime,"12,42 * * * *"
dbt_run_scheduled_non_realtime,"12 * * * *"
dbt_run_streamline_chainhead,"5,35 * * * *"
dbt_run_streamline_decoder,"20,50 * * * *"
dbt_run_scheduled_curated,"30 * * * *"
dbt_run_streamline_decoder,"23 * * * *"
dbt_run_scheduled_curated,"30 */6 * * *"
dbt_test_intraday,"30 */4 * * *"
dbt_test_tasks,"5 * * * *"
dbt_run_streamline_decoded_logs_history,"5 11 * * 6"
dbt_run_scheduled_decoded_logs_history_user_abis,"9 23 * * *"
dbt_run_abi_refresh,"10 23 * * *"
1 workflow_name workflow_schedule
2 dbt_run_scheduled_non_realtime 12,42 * * * * 12 * * * *
3 dbt_run_streamline_chainhead 5,35 * * * *
4 dbt_run_streamline_decoder 20,50 * * * * 23 * * * *
5 dbt_run_scheduled_curated 30 * * * * 30 */6 * * *
6 dbt_test_intraday 30 */4 * * *
dbt_test_tasks 5 * * * *
7 dbt_run_streamline_decoded_logs_history 5 11 * * 6
8 dbt_run_scheduled_decoded_logs_history_user_abis dbt_run_abi_refresh 9 23 * * * 10 23 * * *

View File

@ -26,7 +26,7 @@ FROM
{% endif %}
order by total_interaction_count desc
LIMIT
50
400
), all_contracts AS (
SELECT
contract_address
@ -48,7 +48,7 @@ row_nos AS (
FROM
all_contracts
),
batched AS ({% for item in range(101) %}
batched AS ({% for item in range(501) %}
SELECT
rn.contract_address, live.udf_api('GET', CONCAT('https://api.arbiscan.io/api?module=contract&action=getabi&address=', rn.contract_address, '&apikey={key}'),{ 'User-Agent': 'FlipsideStreamline' },{}, 'Vault/prod/block_explorers/arbiscan') AS abi_data, SYSDATE() AS _inserted_timestamp
FROM