【Kafka】对 kafka 消费程序客户端进行监控采集

前言

对于 Kafka 组件而言,我们通常会对 kafka 服务端添加一些监控,来确保服务的稳定性,虽然有 kafka-exporter 来对消费者进行监控,但是指标很少,对于生产者和消费者更细粒度的监控就无法做到了。只能将监控部署在客户端上,这样我们就能拿到更加详细的监控数据。

例如:对于消费者来说,我们可以获取到消费者重平衡次数,每次poll 数据的条数等等。

这里梳理下如何对消费者添加 JMX 监控。

一、所需组件

这里我们只针对于 JAVA 语言的 KAFKA 客户端为例,需要以下东西:

  • kafka-client:3.4.1
  • JMX-exporter

需要提前准备好 kafka 服务和创建好topic。

二、编写测试代码

1. pom 文件

 <properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target><kafka.version>3.4.1</kafka.version></properties><dependencies><dependency><groupId>org.apache.kafka</groupId><artifactId>kafka-clients</artifactId><version>${kafka.version}</version></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-assembly-plugin</artifactId><version>3.3.0</version><configuration><descriptorRefs><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs></configuration><executions><execution><id>make-assembly</id><phase>package</phase><goals><goal>single</goal></goals></execution></executions></plugin></plugins></build>

2. 生产者代码

public class ProducerDemo {public static void main(String[] args) {//主题(当主题不存在,自动创建主题)String topic = "test";//配置Properties properties = new Properties();//kafka服务器地址properties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.195.132:9092");//反序列化器properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,StringSerializer.class);//生产者KafkaProducer<String,String> kafkaProducer = new KafkaProducer(properties);//生产信息for (int i = 0; i < 100; i++) {String msg = String.format("hello,第%d条信息", i);//消息(key可以为null,key值影响消息发往哪个分区)ProducerRecord<String, String> producerRecord = new ProducerRecord<String, String>(topic, String.valueOf(i), msg);//发送kafkaProducer.send(producerRecord);System.out.println("发送第"+i+"条信息");}//关闭kafkaProducer.close();}
}

3. 消费者代码

public class ConsumerDemo {public static void main(String[] args) throws Exception{//主题String topic = "test";//配置Properties properties = new Properties();//kafka服务器地址properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"192.168.195.132:9092");//k,v的序列化器properties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);properties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,StringDeserializer.class);//消费者分组properties.put(ConsumerConfig.GROUP_ID_CONFIG,"Consumer-Group-1");//offset重置模式properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"earliest");//消费者KafkaConsumer<String, String> kafkaConsumer = new KafkaConsumer(properties);//订阅(可以订阅多个主题)kafkaConsumer.subscribe(Collections.singletonList(topic));//消费while (true){//获取信息ConsumerRecords<String, String> records = kafkaConsumer.poll(Duration.ofMillis(1000));//遍历records.forEach(o->{System.out.println(String.format("topic==%s,offset==%s,key==%s,value==%s",o.topic(),o.offset(),o.key(),o.value()));});//睡眠Thread.sleep(500);}}
}

4. 打包

mvn clean package

5. 测试生产和消费

生产数据测试:

java -cp kafka-1.0-jar-with-dependencies.jar      ProducerDemo

在这里插入图片描述
消费数据测试:

java -cp kafka-1.0-jar-with-dependencies.jar      ConsumerDemo

在这里插入图片描述

三、使用jmx-agent

1. 下载

https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.18.0/jmx_prometheus_javaagent-0.18.0.jar

2. 编写kafka-client.yaml

---
lowercaseOutputName: true
lowercaseOutputLabelNames: true
whitelistObjectNames:- "kafka.consumer:*"- "kafka.producer:*"
blacklistObjectNames:- "kafka.admin.client:*"- "kafka.consumer:type=*,id=*"- "kafka.producer:type=*,id=*"- "kafka.*:type=kafka-metrics-count,*"
rules:# "kafka.consumer:type=app-info,client-id=*"# "kafka.producer:type=app-info,client-id=*"- pattern: "kafka.(.+)<type=app-info, client-id=(.+)><>(.+): (.+)"value: 1name: kafka_$1_app_infocache: truelabels:client_type: $1client_id: $2$3: $4type: UNTYPED# "kafka.consumer:type=consumer-metrics,client-id=*, protocol=*, cipher=*"# "kafka.consumer:type=type=consumer-fetch-manager-metrics,client-id=*, topic=*, partition=*"# "kafka.producer:type=producer-metrics,client-id=*, protocol=*, cipher=*"- pattern: "kafka.(.+)<type=(.+), (.+)=(.+), (.+)=(.+), (.+)=(.+)><>(.+):"name: kafka_$1_$2_$9type: GAUGEcache: truelabels:client_type: $1$3: "$4"$5: "$6"$7: "$8"# "kafka.consumer:type=consumer-node-metrics,client-id=*, node-id=*"# "kafka.consumer:type=consumer-fetch-manager-metrics,client-id=*, topic=*"# "kafka.producer:type=producer-node-metrics,client-id=*, node-id=*"# "kafka.producer:type=producer-topic-metrics,client-id=*, topic=*"- pattern: "kafka.(.+)<type=(.+), (.+)=(.+), (.+)=(.+)><>(.+):"name: kafka_$1_$2_$7type: GAUGEcache: truelabels:client_type: $1$3: "$4"$5: "$6"# "kafka.consumer:type=consumer-fetch-manager-metrics,client-id=*"# "kafka.consumer:type=consumer-metrics,client-id=*"# "kafka.producer:type=producer-metrics,client-id=*"- pattern: "kafka.(.+)<type=(.+), (.+)=(.+)><>(.+):"name: kafka_$1_$2_$5type: GAUGEcache: truelabels:client_type: $1$3: "$4"- pattern: "kafka.(.+)<type=(.+)><>(.+):"name: kafka_$1_$2_$3cache: truelabels:client_type: $1

yaml 参考:https://github.com/confluentinc/jmx-monitoring-stacks/blob/main/shared-assets/jmx-exporter/kafka_client.yml

3. 重新启动消费程序

java -cp kafka-1.0-jar-with-dependencies.jar -javaagent:/opt/javaProject/jmx_prometheus_javaagent-0.18.0.jar=1234:/opt/javaProject/kafka_client.yml ConsumerDemo
4. 打开web ui

访问http://xxx.xxx.xxx.xxx:1234
在这里插入图片描述
这里就能看到我们采集到了kafka 消费者实例的详细指标。我们就可以和Prometheus进行集成,这里就不详细介绍了。

四、具体指标

想要获取更多的指标和指标具体的用途可以参考官网的文档
https://kafka.apache.org/documentation/#consumer_monitoring

具体指标如下:
以下是添加了中文翻译后的Kafka Consumer Metrics表格:

Consumer Coordinator Metrics

METRIC NAMEDESCRIPTIONMBEAN NAME中文描述
commit-latency-avgThe average time taken for a commit requestkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)提交请求的平均时间
commit-latency-maxThe max time taken for a commit requestkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)提交请求的最大时间
commit-rateThe number of commit calls per secondkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)每秒提交调用次数
commit-totalThe total number of commit callskafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)提交调用的总次数
assigned-partitionsThe number of partitions currently assigned to this consumerkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)当前分配给该消费者的分区数量
heartbeat-response-time-maxThe max time taken to receive a response to a heartbeat requestkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)接收到心跳请求响应的最大时间
heartbeat-rateThe average number of heartbeats per secondkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)每秒心跳次数的平均值
heartbeat-totalThe total number of heartbeatskafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)心跳的总次数
join-time-avgThe average time taken for a group rejoinkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)加入组的平均时间
join-time-maxThe max time taken for a group rejoinkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)加入组的最大时间
join-rateThe number of group joins per secondkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)每秒加入组的次数
join-totalThe total number of group joinskafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)加入组的总次数
sync-time-avgThe average time taken for a group synckafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)同步组的平均时间
sync-time-maxThe max time taken for a group synckafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)同步组的最大时间
sync-rateThe number of group syncs per secondkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)每秒同步组的次数
sync-totalThe total number of group syncskafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)同步组的总次数
rebalance-latency-avgThe average time taken for a group rebalancekafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)组重新平衡的平均时间
rebalance-latency-maxThe max time taken for a group rebalancekafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)组重新平衡的最大时间
rebalance-latency-totalThe total time taken for group rebalances so farkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)到目前为止组重新平衡的总时间
rebalance-totalThe total number of group rebalances participatedkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)参与的组重新平衡总次数
rebalance-rate-per-hourThe number of group rebalance participated per hourkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)每小时参与的组重新平衡次数
failed-rebalance-totalThe total number of failed group rebalanceskafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)失败的组重新平衡总次数
failed-rebalance-rate-per-hourThe number of failed group rebalance events per hourkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)每小时失败的组重新平衡事件次数
last-rebalance-seconds-agoThe number of seconds since the last rebalance eventkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)自上次重新平衡事件以来的秒数
last-heartbeat-seconds-agoThe number of seconds since the last controller heartbeatkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)自上次控制器心跳以来的秒数
partitions-revoked-latency-avgThe average time taken by the on-partitions-revoked rebalance listener callbackkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)分区撤销重新平衡监听器回调的平均时间
partitions-revoked-latency-maxThe max time taken by the on-partitions-revoked rebalance listener callbackkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)分区撤销重新平衡监听器回调的最大时间
partitions-assigned-latency-avgThe average time taken by the on-partitions-assigned rebalance listener callbackkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)分配分区重新平衡监听器回调的平均时间
partitions-assigned-latency-maxThe max time taken by the on-partitions-assigned rebalance listener callbackkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)分配分区重新平衡监听器回调的最大时间
partitions-lost-latency-avgThe average time taken by the on-partitions-lost rebalance listener callbackkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)丢失分区重新平衡监听器回调的平均时间
partitions-lost-latency-maxThe max time taken by the on-partitions-lost rebalance listener callbackkafka.consumer:type=consumer-coordinator-metrics,client-id=([-.\w]+)丢失分区重新平衡监听器回调的最大时间

Consumer Fetch Metrics

METRIC NAMEDESCRIPTIONMBEAN NAME中文描述
bytes-consumed-rateThe average number of bytes consumed per secondkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”每秒消费的字节平均数量
bytes-consumed-totalThe total number of bytes consumedkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”消费的字节总数
fetch-latency-avgThe average time taken for a fetch requestkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”提取请求的平均时间
fetch-latency-maxThe max time taken for any fetch requestkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”提取请求的最大时间
fetch-rateThe number of fetch requests per secondkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”每秒提取请求的次数
fetch-size-avgThe average number of bytes fetched per requestkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”每次请求提取的字节平均数量
fetch-size-maxThe maximum number of bytes fetched per requestkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”每次请求提取的字节最大数量
fetch-throttle-time-avgThe average throttle time in mskafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”平均限速时间(毫秒)
fetch-throttle-time-maxThe maximum throttle time in mskafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”最大限速时间(毫秒)
fetch-totalThe total number of fetch requestskafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”提取请求的总次数
records-consumed-rateThe average number of records consumed per secondkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”每秒消费的记录平均数量
records-consumed-totalThe total number of records consumedkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”消费的记录总数
records-lag-maxThe maximum lag in terms of number of records for any partition in this windowkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”任一分区的记录最大滞后数量
records-lead-minThe minimum lead in terms of number of records for any partition in this windowkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”任一分区的记录最小领先数量
records-per-request-avgThe average number of records in each requestkafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”每次请求的记录平均数量
bytes-consumed-rateThe average number of bytes consumed per second for a topickafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”,topic=“{topic}”每秒消费的字节平均数量(按主题)
bytes-consumed-totalThe total number of bytes consumed for a topickafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”,topic=“{topic}”消费的字节总数(按主题)
fetch-size-avgThe average number of bytes fetched per request for a topickafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”,topic=“{topic}”每次请求提取的字节平均数量(按主题)
fetch-size-maxThe maximum number of bytes fetched per request for a topickafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”,topic=“{topic}”每次请求提取的字节最大数量(按主题)
records-consumed-rateThe average number of records consumed per second for a topickafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”,topic=“{topic}”每秒消费的记录平均数量(按主题)
records-consumed-totalThe total number of records consumed for a topickafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”,topic=“{topic}”消费的记录总数(按主题)
records-per-request-avgThe average number of records in each request for a topickafka.consumer:type=consumer-fetch-manager-metrics,client-id=“{client-id}”,topic=“{topic}”每次请求的记录平均数量(按主题)
preferred-read-replicaThe current read replica for the partition, or -1 if reading from leaderkafka.consumer:type=consumer-fetch-manager-metrics,partition=“{partition}”,topic=“{topic}”,client-id=“{client-id}”当前分区的读取副本,若从领导者读取则为-1
records-lagThe latest lag of the partitionkafka.consumer:type=consumer-fetch-manager-metrics,partition=“{partition}”,topic=“{topic}”,client-id=“{client-id}”分区的最新滞后数量
records-lag-avgThe average lag of the partitionkafka.consumer:type=consumer-fetch-manager-metrics,partition=“{partition}”,topic=“{topic}”,client-id=“{client-id}”分区的平均滞后数量
records-lag-maxThe max lag of the partitionkafka.consumer:type=consumer-fetch-manager-metrics,partition=“{partition}”,topic=“{topic}”,client-id=“{client-id}”分区的最大滞后数量
records-leadThe latest lead of the partitionkafka.consumer:type=consumer-fetch-manager-metrics,partition=“{partition}”,topic=“{topic}”,client-id=“{client-id}”分区的最新领先数量
records-lead-avgThe average lead of the partitionkafka.consumer:type=consumer-fetch-manager-metrics,partition=“{partition}”,topic=“{topic}”,client-id=“{client-id}”分区的平均领先数量
records-lead-minThe min lead of the partitionkafka.consumer:type=consumer-fetch-manager-metrics,partition=“{partition}”,topic=“{topic}”,client-id=“{client-id}”分区的最小领先数量

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://xiahunao.cn/news/3280178.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

Java | Leetcode Java题解之第307题区域和检索-数组可修改

题目&#xff1a; 题解&#xff1a; class NumArray {private int[] tree;private int[] nums;public NumArray(int[] nums) {this.tree new int[nums.length 1];this.nums nums;for (int i 0; i < nums.length; i) {add(i 1, nums[i]);}}public void update(int inde…

C++(week15): C++提高:(三)计算机网络

文章目录 一、计算机网络基础1.协议概念2.分层模型3.协议格式(1)以太网帧格式(2)IP段格式(3)TCP/UDP数据报格式4.TCP协议(1)TCP协议的特点(2)三次握手(3)四次挥手(4)SYN攻击5.状态迁移图的解析:11种状态6.TCP通信状态与程序结合分析二、网络编程(Socket编程)1.网络编程基础2.字…

快速识别音频文件转成文字

一、SenseVoice概述 阿里云通义千问开源了两款语音基座模型 SenseVoice&#xff08;用于语音识别&#xff09;和 CosyVoice&#xff08;用于语音生成&#xff09;。 SenseVoice 专注于高精度多语言语音识别、情感辨识和音频事件检测&#xff0c;有以下特点&#xff1a; 多语言…

数据结构与算法 - 数组

一、数组 1. 概述 定义&#xff1a;在计算机科学中&#xff0c;数组是由一组元素&#xff08;值或变量&#xff09;组成的数据结构&#xff0c;每个元素有至少一个索引或键来标识。 因为数组内的元素是连续存储的&#xff0c;所以数组中元素的地址&#xff0c;可以通过其索引…

手把手教你用家用电脑完成图片和视频AI去水印功能

一.效果展示 二.video-subtitle-remover源码地址 soda151314/video-subtitle-remover: 基于AI的图片/视频硬字幕去除、文本水印去除&#xff0c;无损分辨率生成去字幕、去水印后的图片/视频文件。无需申请第三方API&#xff0c;本地实现。AI-based tool for removing hard-cod…

随堂测小程序的设计

管理员账户功能包括&#xff1a;系统首页&#xff0c;个人中心&#xff0c;学生管理&#xff0c;教师管理&#xff0c;试题信息管理&#xff0c;标签类型管理&#xff0c;系统管理 微信端账号功能包括&#xff1a;系统首页&#xff0c;考试成绩&#xff0c;试题信息&#xff0…

SOMEIPSRV_RPC_11: 字段的设定器和有效载荷

测试目的&#xff1a; 验证字段的setter方法是否按照规范要求&#xff0c;通过请求/响应调用实现&#xff0c;其中请求消息的负载包含期望的字段值&#xff0c;响应消息的负载包含已设置到字段的值。 描述 本测试用例旨在验证DUT&#xff08;Device Under Test&#xff0c;被…

【区块链+绿色低碳】碳低链 | FISCO BCOS应用案例

在碳中和、碳达峰国家战略的号召下&#xff0c;碳中和数字化、协同低碳的发展如火如荼。但是在金融业的实际场景应用中&#xff0c; 存在数据收集效率低、数据核查困难、服务单一等问题&#xff0c;痛点集中为两个&#xff1a;一是数据冗杂&#xff0c;可能会存在数据篡改&…

MySQL存储引擎和

MySQL存储引擎 在数据库中保存的是一张张有着千丝万缕关系的表&#xff0c;所以表设计的好坏&#xff0c;将直接影响着整个数据库。而在设计表的时候&#xff0c;最关注的一个问题是使用什么存储引擎。MySQL中的数据用各种不同的技术存储在文件(或者内存)中。这些技术中的每一种…

LeetCode 144.二叉树的前序遍历 C写法

LeetCode 144.二叉树的前序遍历 思路&#x1f9d0;&#xff1a; 遍历很简单&#xff0c;但是我们需要开空间进行值的存储&#xff0c;结点个数也可以用递归进行统计&#xff0c;开好空间就可以用数组进行值的存储&#xff0c;注意下标要么用全局&#xff0c;要么指针解引用&…

Astro 实现TodoList网页应用案例

Astro 是一个现代化的静态站点生成器和前端框架&#xff0c;它具有独特的设计理念&#xff1a;岛屿架构。它允许开发人员使用组件化的方式构建内容优先的网站&#xff0c;将各种技术栈&#xff08;如React、Vue、Svelte等&#xff09;的组件无缝集成到同一个项目中。 1、创建项…

使用注意力机制的seq2seq

一、背景 1、机器翻译中&#xff0c;每个生成的词可能相关于源句子中不同的词&#xff0c;但是之前用的是最后一个RNN层出来的context。 2、加入注意力 &#xff08;1&#xff09;假设输入序列中有&#x1d447;个词元&#xff0c; 解码时间步&#x1d461;′的上下文变量是…

​LLM大模型从入门到精通(7)--企业大模型开发流程​

一、大模型项目开发的两种方式 2023年以来&#xff0c;随着ChatGPT的火爆&#xff0c;使得LLM成为研究和应用的热点&#xff0c;但是市面上大部分LLM都存在一个共同的问题&#xff1a;模型都是基于过去的经验数据进行训练完成&#xff0c;无法获取最新的知识&#xff0c;以及各…

最新Python编程、机器学习与深度学习应用

近年来&#xff0c;人工智能领域的飞速发展极大地改变了各个行业的面貌。当前最新的技术动态&#xff0c;如大型语言模型和深度学习技术的发展&#xff0c;展示了深度学习和机器学习技术的强大潜力&#xff0c;成为推动创新和提升竞争力的关键。特别是PyTorch&#xff0c;凭借其…

昇思25天学习打卡营第26天|munger85

ShuffleNet图像分类 和mobilenet一样&#xff0c;也是在资源有限的设备上进行神经网络来做ai图像分类的小模型&#xff0c;在保持精度的同时大大降低了模型的计算量。 是基本块 就是真正的网络&#xff0c;如果模型size是2&#xff0c;就是输出的时候多一些&#xff0c;精细一…

jdk版本管理利器-sdkman

1.什么是sdkman&#xff1f; sdkman是一个轻量级、支持多平台的开源开发工具管理器&#xff0c;可以通过它安装任意主流发行版本&#xff08;例如OpenJDK、Kona、GraalVM等等&#xff09;的任意版本的JDK。通过下面的命令可以轻易安装sdkman: 2.安装 curl -s "https://…

安装 moleculeSTM 踩坑日记

“学习 LLM &#xff0c;在大模型时代为自己存张船票”。 相信很多人都有这样的想法。那么&#xff0c;在 AI for science 领域&#xff0c;哪些 LLM 模型值得一试呢&#xff1f; 笔者认为&#xff1a; LLM 直接预测 SMILES 性质 or 直接生成 SMILES 的技术路线是行不通的。因…

系统移植(十)Linux内核源码解析(未整理)

1、分析make <board_name>_defconfig执行过程详解 分析Makefile文件&#xff0c;分析Makefile文件的规则中目标为"<board_name>_defconfig", 打开linux内核源码目录下的Makefile,搜索“%config”字符串&#xff0c;得到以下结果 %config: scripts_basic …

进程间通信--套接字socket

前面提到的管道、消息队列、共享内存、信号和信号量都是在同一台主机上进行进程间通信&#xff0c;那要想跨网络与不同主机上的进程之间通信&#xff0c;就需要Socket通信了。 实际上&#xff0c;Socket通信不仅可以跨网络与不同主机的进程间通信&#xff0c;还可以在同主机上…

安防监控视频平台LntonAIServer视频监控管理平台裸土检测算法

LntonAIServer裸土检测算法代表了一种先进的土地监测技术&#xff0c;它利用人工智能的强劲能力&#xff0c;实现了对裸土区域的自动识别和实时监测。该算法的推出&#xff0c;为环境保护、农业管理以及城市规划等多个领域提供了创新的解决方案&#xff0c;其应用前景广阔&…