-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
622 additions
and
357 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
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 |
---|---|---|
@@ -1,22 +1,39 @@ | ||
from flask import Flask | ||
""" | ||
This script runs the application using a development server. | ||
It contains the definition of routes and views for the application. | ||
""" | ||
|
||
# If you get an error on the next line on Python 3.4.0, change to: Flask('app') | ||
# where app matches the name of this file without the .py extension. | ||
from flask import Flask | ||
app = Flask(__name__) | ||
|
||
# Make the WSGI interface available at the top level so wfastcgi can get it. | ||
wsgi_app = app.wsgi_app | ||
|
||
# Configure App | ||
import config | ||
app.config.from_object(config) | ||
|
||
# Import Modules | ||
from routes import * | ||
from processors import * | ||
from filters import * | ||
|
||
# Make the WSGI interface available at the top level so wfastcgi can get it. | ||
wsgi_app = app | ||
|
||
if __name__ == '__main__': | ||
import os | ||
host = os.environ.get('SERVER_HOST', 'localhost') | ||
HOST = os.environ.get('SERVER_HOST', 'localhost') | ||
try: | ||
port = int(os.environ.get('SERVER_PORT', '5555')) | ||
PORT = int(os.environ.get('SERVER_PORT', '5555')) | ||
except ValueError: | ||
port = 5555 | ||
app.run(host, port, threaded=True, debug=False) | ||
PORT = 5555 | ||
|
||
if not app.debug: | ||
import logging | ||
from logging.handlers import RotatingFileHandler | ||
from logging import Formatter | ||
file_handler = RotatingFileHandler('app.log', maxBytes = 10240, backupCount = 3, encoding = 'utf-8') | ||
file_handler.setLevel(logging.WARNING) | ||
file_handler.setFormatter(Formatter('%(asctime)s %(levelname)s: %(message)s ''[in %(pathname)s:%(lineno)d]')) | ||
app.logger.addHandler(file_handler) | ||
|
||
app.run(HOST, PORT, threaded=True) | ||
|
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,4 @@ | ||
AZURE = False | ||
DEBUG = True | ||
CONNECTION_STRING = "DRIVER={SQL Server};SERVER=localhost;DATABASE=SSISDB;UID=dm;PWD=Passw0rd!" | ||
HOUR_SPAN = 720 |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SELECT folder_id, name, [description] FROM [catalog].folders |
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,11 @@ | ||
SELECT | ||
f.folder_id, | ||
f.name, | ||
project_id, | ||
p.folder_id, | ||
p.name, | ||
p.[description] | ||
FROM | ||
[catalog].projects p | ||
INNER JOIN | ||
[catalog].folders f ON p.folder_id = f.folder_id |
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,54 @@ | ||
DECLARE @executionIdFilter BIGINT = ?; | ||
|
||
WITH | ||
ctePRE AS | ||
( | ||
SELECT * FROM catalog.event_messages em | ||
WHERE em.event_name IN ('OnPreExecute') | ||
|
||
), | ||
ctePOST AS | ||
( | ||
SELECT * FROM catalog.event_messages em | ||
WHERE em.event_name IN ('OnPostExecute') | ||
), | ||
cteFINAL AS | ||
( | ||
SELECT | ||
rn = ROW_NUMBER() OVER (PARTITION BY b.event_message_id ORDER BY e.event_message_id), | ||
b.event_message_id, | ||
b.message_source_type, | ||
b.package_path, | ||
b.package_name, | ||
b.execution_path, | ||
b.message_source_name, | ||
pre_message_time = b.message_time, | ||
post_message_time = e.message_time | ||
FROM | ||
ctePRE b | ||
LEFT OUTER JOIN | ||
ctePOST e ON b.operation_id = e.operation_id AND b.package_name = e.package_name AND b.message_source_id = e.message_source_id AND e.event_message_id > b.event_message_id | ||
WHERE | ||
b.operation_id = @executionIdFilter | ||
AND | ||
b.package_path = '\Package' | ||
) | ||
SELECT | ||
event_message_id, | ||
message_source_type, | ||
package_name, | ||
package_path, | ||
execution_path, | ||
message_source_name, | ||
pre_message_time = format(pre_message_time, 'yyyy-MM-dd HH:mm:ss'), | ||
post_message_time = format(post_message_time, 'yyyy-MM-dd HH:mm:ss'), | ||
elapsed_time_min = datediff(mi, pre_message_time, post_message_time) | ||
FROM | ||
cteFINAL | ||
WHERE | ||
rn = 1 | ||
AND | ||
CHARINDEX('\', execution_path, 2) > 0 | ||
ORDER BY | ||
event_message_id desc | ||
; |
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 |
---|---|---|
@@ -1,22 +1,45 @@ | ||
DECLARE @packageNamePattern NVARCHAR(100) = ?; | ||
DECLARE @folderNamePattern NVARCHAR(100) = ?; | ||
DECLARE @projectNamePattern NVARCHAR(100) = ?; | ||
DECLARE @packageNamePattern NVARCHAR(100) = ?; | ||
|
||
SELECT TOP (15) | ||
e.execution_id, | ||
e.project_name, | ||
e.package_name, | ||
e.project_lsn, | ||
e.status, | ||
e.start_time, | ||
e.end_time, | ||
elapsed_time_min = datediff(ss, e.start_time, e.end_time) / 60. | ||
FROM | ||
catalog.executions e | ||
WHERE | ||
e.status IN (2,7) | ||
AND | ||
e.package_name like @packageNamePattern | ||
AND | ||
e.project_name LIKE @projectNamePattern | ||
ORDER BY | ||
e.execution_id DESC | ||
WITH cte AS | ||
( | ||
SELECT TOP (15) | ||
e.execution_id, | ||
e.project_name, | ||
e.package_name, | ||
e.project_lsn, | ||
e.status, | ||
e.start_time, | ||
e.end_time, | ||
elapsed_time_min = datediff(ss, e.start_time, e.end_time) / 60., | ||
avg_elapsed_time_min = avg(datediff(ss, e.start_time, e.end_time) / 60.) OVER (ORDER BY e.start_time ROWS BETWEEN 5 PRECEDING AND CURRENT ROW) | ||
FROM | ||
catalog.executions e | ||
WHERE | ||
e.status IN (2,7) | ||
AND | ||
e.folder_name LIKE @folderNamePattern | ||
AND | ||
e.package_name like @packageNamePattern | ||
AND | ||
e.project_name LIKE @projectNamePattern | ||
ORDER BY | ||
e.execution_id DESC | ||
) | ||
SELECT | ||
execution_id, | ||
project_name, | ||
package_name, | ||
project_lsn, | ||
[status], | ||
start_time = format(start_time, 'yyyy-MM-dd HH:mm:ss'), | ||
end_time = format(CASE WHEN end_time IS NULL THEN dateadd(minute, cast(CEILING(avg_elapsed_time_min) AS int), start_time) ELSE end_time end, 'yyyy-MM-dd HH:mm:ss'), | ||
elapsed_time_min = format(CASE WHEN end_time IS NULL THEN avg_elapsed_time_min ELSE elapsed_time_min end, '#,0.00'), | ||
avg_elapsed_time_min = format(avg_elapsed_time_min, '#,0.00'), | ||
percent_complete = format(100 * (DATEDIFF(ss, start_time, SYSDATETIMEOFFSET()) / 60.) / avg_elapsed_time_min, '#,0.00'), | ||
has_expected_values = CASE WHEN end_time IS NULL THEN 1 ELSE 0 END | ||
FROM | ||
cte | ||
ORDER BY | ||
execution_id DESC |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
Flask<1 | ||
flask |
Oops, something went wrong.