与spark历史服务器交互的python库

spark-monitoring的Python项目详细描述


火花监测

与Spark历史服务器交互的Python库。

快速启动

基本

$ pip install spark-monitoring
importsparkmonitoringassparkmonmonitoring=sparkmon.client('my.history.server')print(monitoring.list_applications())

熊猫

$ pip install spark-monitoring[pandas]
importsparkmonitoringassparkmonimportmatplotlib.pyplotaspltmonitoring=sparkmon.df('my.history.server')apps=monitoring.list_applications()apps['function']=apps.name.str.split('(').str.get(0)print(apps.head().stack())plt.figure()apps['duration'].hist(by=apps['function'],figsize=(40,20))plt.show()jobs=monitoring.list_jobs(apps.iloc[0].id)print(jobs.head().stack())

参考

SparkMonitoring.客户端

方法返回一个客户端,用它调用Spark历史服务器。

参数

NameTypeDescriptionDefault
^{}^{}Hostname or IP pointing to the spark history server
^{}^{}Port which the spark history server is exposed on^{}
^{}^{}Whether or not to use https to communicate with the spark server^{}
^{}^{}API Version to interact with. Currently only ^{} is supported^{}

响应

示例

basic端点

importsparkmonitoringassparkmonclient=sparkmon.client('my.history.server')

自定义端点

importsparkmonitoringassparkmonclient=sparkmon.client('my.history.server',port=8080,is_https=True)

SparkMonitoring.df

方法返回一个客户端,用它调用Spark历史服务器。这个 客户端将返回pandas数据帧,而不是 标准客户。当附加的spark-monitoring[pandas]是 安装。

参数

NameTypeDescriptionDefault
^{}^{}Hostname or IP pointing to the spark history server
^{}^{}Port which the spark history server is exposed on^{}
^{}^{}Whether or not to use https to communicate with the spark server^{}
^{}^{}API Version to interact with. Currently only ^{} is supported^{}

响应

示例

basic端点

importsparkmonitoringassparkmonclient=sparkmon.df('my.history.server')

自定义端点

importsparkmonitoringassparkmonclient=sparkmon.df('my.history.server',port=8080,is_https=True)

sparkmonitoring.api.clientv1

与Spark历史服务器交互的客户端。 通常这个类不是直接实例化的,而是通过 ^{}

参数

NameTypeDescriptionDefault
^{}^{}Hostname or IP pointing to the spark history server
^{}^{}Port which the spark history server is exposed on
^{}^{}Whether or not to use https to communicate with the spark server
^{}^{}API Version to interact with. Currently only ^{} is supported

方法

  • ^{}
  • get_application(...)
  • list_jobs(...)
  • get_job(...)
  • list_stages(...)
  • list_stage_attempts(...)
  • get_stage_attempt(...)
  • get_stage_attempt_summary(...)
  • get_stage_attempt_tasks(...)
  • list_active_executors(...)
  • list_executor_threads(...)
  • list_all_executors(...)

sparkmonitoring.dataframes.pandasclient.list_应用程序

所有应用程序的列表。

参数

NameTypeDescriptionDefault
^{}^{}Type of applications to return
^{}^{}Earliest Application
^{}^{}Latest Application
^{}^{}Number of results to return

sparkmonitoring.dataframes.pandasclient

与Spark历史服务器交互的客户端,返回熊猫 数据帧。 通常这个类不是直接实例化的,而是通过 ^{}

参数

NameTypeDescriptionDefault
^{}^{}Hostname or IP pointing to the spark history server
^{}^{}Port which the spark history server is exposed on^{}
^{}^{}Whether or not to use https to communicate with the spark server^{}
^{}^{}API Version to interact with. Currently only ^{} is supported^{}

方法

  • list_applications(...)
  • get_application(...)
  • list_jobs(...)
  • get_job(...)
  • list_stages(...)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java中是否有数字的默认类型   java调用一个类的方法来使用另一个类的实例   java HtmlUnit不适用于javascript处理   java需要帮助才能连接MongoDB   java如何从Maven中的src/main/resources复制文件?   java保存Int值(共享首选项)   从另一个类调用方法时,java Autowired组件出现空指针异常   java Spring JPA:PropertyAccessException 1:。。。MethodInvocationException:。'driverClassName'。。。org/postgresql/Driver:不支持的专业。次要版本52.0   java使用增强的JDO模型类在Eclipse中运行Junit测试   java如何使用eclipse IDE为junit创建可运行的jar文件   java如何在安卓中检测应用程序的启动和退出   java在其他线程可以访问静态映射时从数据库更新静态映射   java@Entitty和@EntityScan不起作用。我正在使用SpringBoot和jpa存储库,发生了很多次   java如何与google日历集成?