Skip to content

Commit cebfb20

Browse files
authored
Merge pull request #100572 from su-jie/jobdiagram
Add doc for job diagram in VS
2 parents e21b669 + e6f1a98 commit cebfb20

13 files changed

+135
-10
lines changed

articles/stream-analytics/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@
176176
href: stream-analytics-live-data-local-testing.md
177177
- name: View jobs in Visual Studio
178178
href: stream-analytics-vs-tools.md
179+
- name: Debug queries using job diagram
180+
href: debug-locally-using-job-diagram.md
179181
- name: Develop an edge job
180182
href: stream-analytics-tools-for-visual-studio-edge-jobs.md
181183
- name: Set up CI/CD pipeline
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: Debug Azure Stream Analytics queries locally using job diagram in Visual Studio
3+
description: This article describes how to debug queries locally using job diagram in Azure Stream Analytics Tools for Visual Studio.
4+
author: su-jie
5+
ms.author: sujie
6+
ms.reviewer: mamccrea
7+
ms.service: stream-analytics
8+
ms.topic: conceptual
9+
ms.date: 01/23/2020
10+
---
11+
12+
# Debug Azure Stream Analytics queries locally using job diagram in Visual Studio
13+
14+
Jobs that output no result or unexpected results are common troubleshooting scenarios for streaming queries. You can use the job diagram while testing your query locally in Visual Studio to examine the intermediate result set and metrics for each step. Job diagrams can help you quickly isolate the source of a problem when you troubleshoot issues.
15+
16+
## Debug a query using job diagram
17+
18+
An Azure Stream Analytics script is used to transform input data to output data. The job diagram shows how data flows from input sources (Event Hub, IoT Hub, etc) through multiple query steps and, finally, to output sinks. Each query step is mapped to a temporary result set defined in the script using a `WITH` statement. You can view the data as well as metrics of each query step in each intermediate result set to find the source of an issue.
19+
20+
> [!NOTE]
21+
> This job diagram only shows the data and metrics for local testing in a single node. It should not be used for performance tuning and troubleshooting.
22+
23+
### Start local testing
24+
25+
Use this [Quickstart](stream-analytics-quick-create-vs.md) to learn how to create a Stream Analytics job using Visual Studio or [export an existing job to a local project](stream-analytics-vs-tools.md#export-jobs-to-a-project). If you want to test the query with local input data, follow these [instructions](stream-analytics-live-data-local-testing.md). If you want to test with live input, move to the next step.
26+
27+
> [!NOTE]
28+
> If you export a job to local project and want to test against a live input stream, you need to specify the credentials for all inputs again.
29+
30+
Choose the input and output source from the script editor and select **Run locally**. The job diagram appears on the right side.
31+
32+
### View the intermediate result set
33+
34+
1. Select the query step to navigate to the script. You are automatically directed to the corresponding script in the editor on the left.
35+
36+
![Job diagram navigate script](./media/debug-locally-using-job-diagram/navigate-script.png)
37+
38+
2. Select the query step and select **Preview** in the popped up dialog. The result set is shown in a tab in the bottom result window.
39+
40+
![Job diagram preview result](./media/debug-locally-using-job-diagram/preview-result.png)
41+
42+
### View step metrics
43+
44+
In this section, you explore the metrics available for each part of the diagram.
45+
46+
#### Input sources (Live stream)
47+
48+
![Job diagram live input sources](./media/debug-locally-using-job-diagram/live-input.png)
49+
50+
|Metric|Description|
51+
|-|-|
52+
|**TaxiRide**| The name of the input.|
53+
|**Event Hub** | Input source type.|
54+
|**Events**|The number of events read.|
55+
|**Backlogged Event Sources**|How many more messages need to be read for Event Hubs and IoT Hub inputs.|
56+
|**Events in Bytes**|The number of bytes read.|
57+
| **Degraded Events**|The count of events that had an issue other than with deserialization.|
58+
|**Early Events**| The number of events that have an application timestamp before the high watermark.|
59+
|**Late Events**| The number of events that have an application timestamp after the high watermark.|
60+
|**Event Sources**| The number of data units read. For example, the number of blobs.|
61+
62+
#### Input sources (Local input)
63+
64+
![Job diagram local input sources](./media/debug-locally-using-job-diagram/local-input.png)
65+
66+
|Metric|Description|
67+
|-|-|
68+
|**TaxiRide**| The name of the input.|
69+
|**Row Count**| The number of rows generated from the step.|
70+
|**Data Size**| The size of data generated from this step.|
71+
|**Local input**| Use local data as input.|
72+
73+
#### Query steps
74+
75+
![Job diagram query step](./media/debug-locally-using-job-diagram/query-step.png)
76+
77+
|Metric|Description|
78+
|-|-|
79+
|**TripData**|The name of the temporary result set.|
80+
|**Row Count**| The number of rows generated from the step.|
81+
|**Data Size**| The size of data generated from this step.|
82+
83+
#### Output sinks (Live output)
84+
85+
![Job diagram local output sinks](./media/debug-locally-using-job-diagram/live-output.png)
86+
87+
|Metric|Description|
88+
|-|-|
89+
|**regionaggEH**|The name of the output.|
90+
|**Events**|The number of events output to sinks.|
91+
92+
#### Output sinks (Local output)
93+
94+
![Job diagram local output sinks](./media/debug-locally-using-job-diagram/local-output.png)
95+
96+
|Metric|Description|
97+
|-|-|
98+
|**regionaggEH**|The name of the output.|
99+
|**Local Output**| Result output to a local file.|
100+
|**Row Count**| The number of rows output to the local file.|
101+
|**Data Size**| The size of data output to the local file.|
102+
103+
### Close job diagram
104+
105+
If you don't need the job diagram anymore, select **Close** on the top right corner. After closing the diagram window, you need to start local testing again to see it.
106+
107+
### View job level metrics and stop running
108+
109+
Other job level metrics shows up in the pop up console. Press **Ctrl+C** in the console if you want to stop the job.
110+
111+
![Job diagram stop job](./media/debug-locally-using-job-diagram/stop-job.png)
112+
113+
## Limitations
114+
115+
* Power BI and Azure Data Lake Storage Gen1 output sinks are not supported due to authentication model limitations.
116+
117+
* Only cloud input options have [time policies](stream-analytics-out-of-order-and-late-events.md) support, while local input options do not.
118+
119+
## Next steps
120+
121+
* [Quickstart: Create a Stream Analytics job using Visual Studio](stream-analytics-quick-create-vs.md)
122+
* [Use Visual Studio to view Azure Stream Analytics jobs](stream-analytics-vs-tools.md)
123+
* [Test live data locally using Azure Stream Analytics tools for Visual Studio (Preview)](stream-analytics-live-data-local-testing.md)
34.7 KB
Loading
9.42 KB
Loading
14.2 KB
Loading
11.1 KB
Loading
173 KB
Loading
169 KB
Loading
11.8 KB
Loading
195 KB
Loading

0 commit comments

Comments
 (0)