[ 
https://issues.apache.org/jira/browse/AIRFLOW-4360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16986787#comment-16986787
 ] 

ASF GitHub Bot commented on AIRFLOW-4360:
-----------------------------------------

kunalyogenshah commented on pull request #5139: [AIRFLOW-4360] Add performance 
metrics for Webserver UI.
URL: https://github.com/apache/airflow/pull/5139
 
 
   ### Jira
   
   - [x] My PR addresses the following 
[AIRFLOW-4360](https://issues.apache.org/jira/browse/AIRFLOW-4360) issues and 
references them in the PR title.
   
   ### Description
   
   This PR extends Statsd usage for tracking webserver metrics as well. For 
starters, we track: 
   1) Log page hits, and log fetching latency + failures.
   2) Tree view and graph view latency + load failures.
   
   ### Tests
   
   Once enabled, you can see the following new counters in Statsd :
   ```
   { counters:
      { 'statsd.bad_lines_seen': 0,
        'statsd.packets_received': 68,
        'statsd.metrics_received': 68,
        'airflow.scheduler_heartbeat': 2,
        'airflow.webserver.tree_view.views': 0,
        'airflow.webserver.tree_view.load_failures': 0,
        'airflow.webserver.graph_view.views': 0,
        'airflow.webserver.graph_view.load_failures': 0,
        'airflow.webserver.log.views': 1,
        'airflow.webserver.log.load_failures': 0,
        'airflow.webserver.ajax_logs_fetch.load_failures': 0 },
     timers:
      { 'airflow.webserver.tree_view.load_time': [],
        'airflow.webserver.graph_view.load_time': [],
        'airflow.webserver.ajax_logs_fetch.load_time': [ 17.852 ] },
     gauges:
      { 'airflow.collect_dags': 0.046903,
        'airflow.dagbag_size': 1,
        'airflow.dagbag_import_errors': 0,
        'statsd.timestamp_lag': 0,
        'airflow.pool.starving_tasks.not_pooled': 0 },
     timer_data:
      { 'airflow.webserver.tree_view.load_time': { count_ps: 0, count: 0 },
        'airflow.webserver.graph_view.load_time': { count_ps: 0, count: 0 },
        'airflow.webserver.ajax_logs_fetch.load_time':
         { count_90: 1,
           mean_90: 17.852,
           upper_90: 17.852,
           sum_90: 17.852,
           sum_squares_90: 318.69390400000003,
           std: 0,
           upper: 17.852,
           lower: 17.852,
           count: 1,
           count_ps: 0.1,
           sum: 17.852,
           sum_squares: 318.69390400000003,
           mean: 17.852,
           median: 17.852 } },
     counter_rates:
      { 'statsd.bad_lines_seen': 0,
        'statsd.packets_received': 6.8,
        'statsd.metrics_received': 6.8,
        'airflow.scheduler_heartbeat': 0.2,
        'airflow.webserver.tree_view.views': 0,
        'airflow.webserver.tree_view.load_failures': 0,
        'airflow.webserver.graph_view.views': 0,
        'airflow.webserver.graph_view.load_failures': 0,
        'airflow.webserver.log.views': 0.1,
        'airflow.webserver.log.load_failures': 0,
        'airflow.webserver.ajax_logs_fetch.load_failures': 0 },
     sets: {},
     pctThreshold: [ 90 ] }
   ```
   
   ### Commits
   
   - [ ] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes 
how to use it.
     - All the public functions and the classes in the PR contain docstrings 
that explain what it does
     - If you implement backwards incompatible changes, please leave a note in 
the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so 
we can assign it to a appropriate release
   
   ### Code Quality
   
   - [ ] Passes `flake8`
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add metrics for measuring Airflow Webserver performance using Statsd
> --------------------------------------------------------------------
>
>                 Key: AIRFLOW-4360
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4360
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: webserver
>            Reporter: Kunal Shah
>            Assignee: Kunal Shah
>            Priority: Minor
>
> There are few metrics that are valuable to track for Webserver performance:
> 1) How long does tree / graph view take to load DAGs? How many failures?
> 2) How long does it take to fetch logs from the AJAX endpoint? Does it ever 
> fail? How often do DAG creators view their task logs?
> Such metrics can be extended further to other actions like manual running, 
> deleting, clearing of tasks and dagruns.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to