Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16294#discussion_r93717198
  
    --- Diff: docs/structured-streaming-programming-guide.md ---
    @@ -1089,46 +1276,94 @@ spark.streams().awaitAnyTermination()  # block 
until any one of them terminates
     
     
     ## Monitoring Streaming Queries
    -There are two ways you can monitor queries. You can directly get the 
current status
    -of an active query using `streamingQuery.status`, which will return a 
`StreamingQueryStatus` object
    
-([Scala](api/scala/index.html#org.apache.spark.sql.streaming.StreamingQueryStatus)/[Java](api/java/org/apache/spark/sql/streaming/StreamingQueryStatus.html)/[Python](api/python/pyspark.sql.html#pyspark.sql.streaming.StreamingQueryStatus)
 docs)
    -that has all the details like current ingestion rates, processing rates, 
average latency,
    -details of the currently active trigger, etc.
    +There are two APIs for monitoring and debugging active queries - 
    +interactively and asynchronously.
    +
    +### Interactive APIs
    +
    +You can directly get the current status and metrics of an active query 
using 
    +`streamingQuery.lastProgress()` and `streamingQuery.status()`. 
    +`lastProgress()` returns a `StreamingQueryProgress` object 
    +in 
[Scala](api/scala/index.html#org.apache.spark.sql.streaming.StreamingQueryProgress)
 
    +and 
[Java](api/java/org/apache/spark/sql/streaming/StreamingQueryProgress.html)
    +and an dictionary with the same fields in Python. It has all the 
information about
    +the progress made in the last trigger of the stream - what data was 
processed, 
    +what were the processing rates, latencies, etc. There is also 
    +`streamingQuery.recentProgress` which returns an array of last few 
progresses.  
    +
    +In addition, `streamingQuery.status()` returns `StreamingQueryStatus` 
object 
    +in 
[Scala](api/scala/index.html#org.apache.spark.sql.streaming.StreamingQueryStatus)
 
    +and 
[Java](api/java/org/apache/spark/sql/streaming/StreamingQueryStatus.html)
    +and an dictionary with the same fields in Python. It gives information 
about
    +what the query is immediately doing - is a trigger active, is data being 
processed, etc.
    +
    +Here are a few examples.
     
     <div class="codetabs">
     <div data-lang="scala"  markdown="1">
     
     {% highlight scala %}
     val query: StreamingQuery = ...
     
    +println(query.progress)
    --- End diff --
    
    nit: `query.lastProgress`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to