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
""" | |
Win32 virtual-key (VK) constants for Python, extracted from winuser.h with | |
comments. | |
Original copyright notice printed below: | |
/**************************************************************************** | |
* * | |
* winuser.h -- USER procedure declarations, constant definitions and macros * | |
* * | |
* Copyright (c) Microsoft Corporation. All rights reserved. * |
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
import subprocess | |
def get_msmdsrv() -> list: | |
msmdsrv = subprocess.check_output( | |
[ | |
"powershell", | |
"""Get-CimInstance -ClassName Win32_Process -Property * -Filter "Name = 'msmdsrv.exe'" | Select-Object -Property ProcessId -ExpandProperty ProcessId""", | |
] | |
) |
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
import pytabular | |
model = pytabular.Tabular(CONNECTION_STR) | |
df = pytabular.Table_Last_Refresh_Times(model, group_partition = False) | |
model.Create_Table(df, 'Refresh Times') |
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
import pytabular | |
model = pytabular.Tabular(CONNECTION_STR) | |
tables = pytabular.Return_Zero_Row_Tables() | |
if len(tables) > 0: | |
model.Refresh(tables, Tracing = True) #Add a trace in there for some fun. |
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
#You have a few options when refreshing. | |
model.Refresh('Table Name') | |
#or... | |
model.Refresh(['Table1','Table2','Table3']) | |
#or... | |
model.Refresh(<Table Class>) | |
#or... |
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
#Run basic queries | |
DAX_QUERY = "EVALUATE TOPN(100, 'Table1')" | |
model.Query(DAX_QUERY) #returns pd.DataFrame() | |
#or... | |
DMV_QUERY = "select * from $SYSTEM.DISCOVER_TRACE_EVENT_CATEGORIES" | |
model.Query(DMV_QUERY) #returns pd.DataFrame() | |
#or... | |
SINGLE_VALUE_QUERY_EX = "EVALUATE {1}" |
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
import pytabular | |
model = pytabular.Tabular(CONNECTION_STR) |
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
Start_Time [Local Time] | End_Time [Local Time] | Table | Column | Duration_Seconds | Text | Database | Model | Partition | Resource | |
---|---|---|---|---|---|---|---|---|---|---|
Start Time | End Time | Sales | QUANTITY | 1.828 | Encoding Details | Database | Model | CFY | Resource1 | |
Start Time | End Time | Sales | TOTAL_AMT | 0.063 | Encoding Details | Database | Model | CFY | Resource1 | |
Start Time | End Time | Product | PRODUCT_SKU | 0.203 | Encoding Details | Database | Model | Partition | Resource1 | |
Start Time | End Time | Product | PRODUCT_SKU | 0.203 | Encoding Details | Database | Model | Partition | Resource1 |
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
AzureDiagnostics | |
| where OperationName == "ProgressReportEnd" | |
| where EventSubclass_s == 55 | |
| project-keep Resource, DatabaseName_s, ObjectReference_s, TextData_s, Duration_s, StartTime_t, EndTime_t | |
| extend Object_Json = parse_xml(ObjectReference_s) | |
| extend Database = tostring(Object_Json.Object.Database) | |
| extend Model = tostring(Object_Json.Object.Model) | |
| extend Table = tostring(Object_Json.Object.Table) | |
| extend Partition = tostring(Object_Json.Object.Partition) | |
| extend Duration_Seconds = toint(Duration_s)/1000.00 |
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
End_Time [Local Time] | Database | Details | Error | Server | Resource | User | Application | |
---|---|---|---|---|---|---|---|---|
4/14/2022, 10:57:32.583 AM | Database1 | Processing Info Like DB, Table, Partition, Max Parallelism, Type | Error Text | Server | Resource | serviceuser@company.com | PowerBi | |
4/14/2022, 10:45:22.583 AM | Database1 | Processing Info Like DB, Table, Partition, Max Parallelism, Type | Error Text | Server | Resource | serviceuser@company.com | TabularEditor | |
4/14/2022, 10:59:32.583 AM | Database1 | Processing Info Like DB, Table, Partition, Max Parallelism, Type | Error Text | Server | Resource | serviceuser@company.com | PowerBi |
NewerOlder