mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add snapshotMetrics script, tidy other scripts
This commit is contained in:
parent
8919ea5eaa
commit
61181e5664
7 changed files with 21 additions and 14 deletions
|
|
@ -41,9 +41,10 @@ EndProject
|
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sql", "sql", "{A4BB2C81-5232-4162-B410-704D123D2C01}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
scripts\sql\createDb.sql = scripts\sql\createDb.sql
|
||||
scripts\sql\failedSnapshotsRules.sql = scripts\sql\failedSnapshotsRules.sql
|
||||
scripts\sql\getDuplicateRules.sql = scripts\sql\getDuplicateRules.sql
|
||||
scripts\sql\duplicateRules.sql = scripts\sql\duplicateRules.sql
|
||||
scripts\sql\orphanedSnapshotsRules.sql = scripts\sql\orphanedSnapshotsRules.sql
|
||||
scripts\sql\resetSnapshotsRules.sql = scripts\sql\resetSnapshotsRules.sql
|
||||
scripts\sql\snapshotMetrics.sql = scripts\sql\snapshotMetrics.sql
|
||||
scripts\sql\snapshotTimeAnalysis.sql = scripts\sql\snapshotTimeAnalysis.sql
|
||||
EndProjectSection
|
||||
EndProject
|
||||
|
|
|
|||
4
scripts/sql/duplicateRules.sql
Normal file
4
scripts/sql/duplicateRules.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
SELECT Raw, COUNT(*) 'Count'
|
||||
FROM rules
|
||||
GROUP BY Raw
|
||||
HAVING COUNT > 1;
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
SELECT snapshotid, COUNT(*)
|
||||
FROM snapshots_rules
|
||||
JOIN snapshots ON snapshots_rules.snapshotid = snapshots.id
|
||||
WHERE snapshots.wassuccessful = FALSE
|
||||
GROUP BY snapshots.id
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
SELECT raw, COUNT(*) ct
|
||||
FROM rules
|
||||
GROUP BY raw
|
||||
HAVING ct > 1;
|
||||
5
scripts/sql/orphanedSnapshotsRules.sql
Normal file
5
scripts/sql/orphanedSnapshotsRules.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
SELECT SnapshotId, COUNT(*)
|
||||
FROM snapshots_rules
|
||||
JOIN snapshots ON snapshots_rules.SnapshotId = snapshots.Id
|
||||
WHERE snapshots.WasSuccessful = FALSE
|
||||
GROUP BY snapshots.Id;
|
||||
6
scripts/sql/snapshotMetrics.sql
Normal file
6
scripts/sql/snapshotMetrics.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
SELECT snapshots.CreatedDateUtc, FilterlistId, HttpStatusCode, WasSuccessful, WaybackTimestamp, BatchSize, COUNT(snapshots_rules.RuleId) AS 'Count'
|
||||
FROM snapshots
|
||||
JOIN snapshots_rules ON snapshots.Id = snapshots_rules.SnapshotId
|
||||
GROUP BY snapshots.Id
|
||||
ORDER BY snapshots.CreatedDateUtc DESC
|
||||
LIMIT 50;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
SELECT
|
||||
FilterListId,
|
||||
ModifiedDateUtc - CreatedDateUtc As ProcessingTimeSecs,
|
||||
ModifiedDateUtc - CreatedDateUtc AS ProcessingTimeSecs,
|
||||
CreatedDateUtc,
|
||||
ModifiedDateUtc,
|
||||
WasSuccessful
|
||||
FROM snapshots
|
||||
WHERE ModifiedDateUtc - CreatedDateUtc > 30 OR IsCompleted = 0
|
||||
ORDER BY ProcessingTimeSecs DESC
|
||||
WHERE ModifiedDateUtc - CreatedDateUtc > 30 OR WasSuccessful = 0
|
||||
ORDER BY ProcessingTimeSecs DESC;
|
||||
Loading…
Reference in a new issue