albertusk95 opened a new pull request #25326: [SPARK-28590][PySpark][WIP] Add 
sort_stats Setter and Getter in Profiler
URL: https://github.com/apache/spark/pull/25326
 
 
   ## What changes were proposed in this pull request?
   
   When I want to use _BasicProfiler_ with different sorters in **sort_stats**, 
I sometimes need to create a custom profiler and implement the **show()** 
method only to replace the following line: `stats.sort_stats("time", 
"cumulative").print_stats()`.
   
   I think it'd be better if the users are able to specify the sorters without 
creating a custom profiler.
   
   I implemented the changes in PySpark only.
   
   To apply the **setter** and **getter** methods, one can use the following 
way:
   
   ```python
   conf = SparkConf().set("spark.python.profile", "true")
   
   # use BasicProfiler
   sc = SparkContext('local', 'test', conf=conf)
   sc.profiler_collector.profiler_cls.set_sort_stats_sorters(BasicProfiler, 
['ncalls', 'tottime', 'name'])
   ```
   
   ## How was this patch tested?
   
   plan to use unit test
   
   Please review https://spark.apache.org/contributing.html before opening a 
pull request.
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to