-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Made sequence for generating group numbers for api logger, and search
and comparison pages will log all their calls using the same api_call_group_id. - Expanded to include all 'Is a' relationships from concept_relationship table in addition to concept_ancestor where min separation = 1 already included. - No longer need an undirected version of the graph - Totally redid subgraph generation and now downloading indented concept list instead of constructing it on the front end based on creating a front-end graph based on subgraph edges from backend. Seems to work, but collapse is broken now...maybe other stuff too.
- Loading branch information
Showing
10 changed files
with
426 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
-- View: apiruns_grouped ------------------------------------------------------------------------------------ | ||
DROP TABLE IF EXISTS public.api_runs CASCADE; | ||
|
||
CREATE TABLE IF NOT EXISTS public.api_runs ( | ||
api_call_group_id integer, | ||
host text, | ||
client text, | ||
schema text not null, | ||
api_call text not null, | ||
codeset_ids integer[], | ||
params text, | ||
timestamp text not null, | ||
result text, | ||
process_seconds float | ||
--date text, | ||
--note text | ||
); | ||
|
||
DROP SEQUENCE IF EXISTS api_call_group_id_seq; | ||
|
||
CREATE SEQUENCE api_call_group_id_seq START 10001; | ||
|
||
CREATE OR REPLACE VIEW public.apiruns_grouped AS ( | ||
WITH RankedGroups AS ( | ||
SELECT | ||
*, | ||
ROW_NUMBER() OVER (PARTITION BY api_call_group_id ORDER BY timestamp::timestamp DESC) AS rn | ||
FROM | ||
public.api_runs | ||
) | ||
SELECT | ||
host, | ||
client, | ||
schema, | ||
api_call_group_id, | ||
/* | ||
codeset_ids, | ||
params, | ||
*/ | ||
ARRAY_AGG(api_call) AS api_calls, | ||
MIN(timestamp::timestamp) as group_start_time, | ||
MAX(timestamp::timestamp) as group_end_time, | ||
(MAX(timestamp::timestamp) - MIN(timestamp::timestamp)) + | ||
CASE WHEN MAX(rn) = 1 THEN MAX(process_seconds) * INTERVAL '1 second' ELSE INTERVAL '0 seconds' END as duration_seconds | ||
FROM | ||
RankedGroups | ||
GROUP BY | ||
api_call_group_id, host, client, schema /* , api_call, codeset_ids, params*/ | ||
ORDER BY api_call_group_id desc -- group_start_time DESC, client | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.