当前位置: 首页 > news >正文

arthas监控工具笔记(二)monior等

文章目录

    • monitor/watch/trace 相关
      • monitor
        • monitor例子
          • monitor -c <value>
          • monitor -m <vaule>
          • monitor 条件表达式
          • monitor -b
        • monitor文档(界面描述)
        • monitor文档(help)
      • stack - 输出当前方法被调用的调用路径
      • trace - 方法内部调用路径,并输出方法路径上的每个节点上耗时
      • tt - 方法执行数据的时空隧道,记录下指定方法每次调用的入参和返回信息,并能对这些不同的时间下调用进行观测
        • tt使用
          • tt 删除
        • tt文档(命令行)
      • watch - 方法执行数据观测
        • watch例子
          • watch target例子
        • watch例子2
        • watch文档(界面)
        • watch文档(命令行)

这是第二章,第一章见博客。

monitor/watch/trace 相关

monitor

monitor是方法监控工具,例如一定时间的次数,成功率,失败率,响应时间等。
还可以根据条件进行过滤。

monitor例子

不加任何参数:
monitor org.apache.commons.lang.StringUtils isBlank

monitor -c

monitor -c 5 org.apache.commons.lang.StringUtils isBlank
-c --cycle 表示统计周期,默认60s。设置为-c 5我们发现命令行每5s打印一次,如果设置为-c 10,每10s打印一次。

monitor -m

monitor -m 1 -c 5 org.apache.commons.lang3.StringUtils isBlank
-m, --maxMatch 表示匹配类的最大限制数,感觉是为了避免相同类内容太多,加上这个参数如果实际类数量>-m的值,会报错。

例如:

[arthas@23052]$ monitor -m 1 -c 5 org.apache.commons.lang3.StringUtils 
isBlank
输出:
Affect(class count: 0 , method count: 0) cost in 9 ms, listenerId: 14
The number of matched classes is 2, greater than the limit value 1. Try to change the limit with option '-m <arg>'.
monitor 条件表达式

monitor -c 5 com.example.controller.api.InvoiceApiContorller invoiceQueryFast “params[0] >1”
“params[0] >1” 在方法执行完之后,根据条件表达式进行过滤。
这里有个疑问啊?
如果是spring的@RequestBody报文,怎么写表达式呢?这个表达式是否只能做一些简单的计算。

monitor -b

monitor -c 5 -b com.example.controller.api.InvoiceApiContorller invoiceQueryFast “params[0] >1”
-b 表示在方法执行完之前,根据条件表达式进行过滤。

monitor文档(界面描述)

参数说明
方法拥有一个命名参数 [c:],意思是统计周期(cycle of output),拥有一个整型的参数值

参数名称 参数说明
class-pattern 类名表达式匹配
method-pattern 方法名表达式匹配
condition-express 条件表达式
[E] 开启正则表达式匹配,默认为通配符匹配
[c:] 统计周期,默认值为 120 秒
[b] 在方法调用之前计算 condition-express
[m ] 指定 Class 最大匹配数量,默认值为 50。长格式为[maxMatch ]。

monitor文档(help)

输入 help monitor,返回的内容就是文档:

help monitor
USAGE:monitor [-b] [-c <value>] [--exclude-class-pattern <value>] [-h] [-n <value>] [--listenerId <value>] [-m <value>] [
-E] [-v] class-pattern method-pattern [condition-express]SUMMARY:Monitor method execution statistics, e.g. total/success/failure count, average rt, fail rate, etc.Examples:monitor org.apache.commons.lang.StringUtils isBlankmonitor org.apache.commons.lang.StringUtils isBlank -c 5monitor org.apache.commons.lang.StringUtils isBlank params[0]!=nullmonitor -b org.apache.commons.lang.StringUtils isBlank params[0]!=nullmonitor -E org\.apache\.commons\.lang\.StringUtils isBlankWIKI:https://arthas.aliyun.com/doc/monitorOPTIONS:
-b, --before                            Evaluate the condition-express before method invoke
-c, --cycle <value>                     The monitor interval (in seconds), 60 seconds by default--exclude-class-pattern <value>     exclude class name pattern, use either '.' or '/' as separator
-h, --help                              this help
-n, --limits <value>                    Threshold of execution times--listenerId <value>                The special listenerId
-m, --maxMatch <value>                  The maximum of matched class.
-E, --regex                             Enable regular expression to match (wildcard matching by default)
-v, --verbose                           Enables print verbose information, default value false.
<class-pattern>                         Path and classname of Pattern Matching
<method-pattern>                        Method of Pattern Matching
<condition-express>                     Conditional expression in ognl style, for example:TRUE  : 1==1TRUE  : trueFALSE : falseTRUE  : 'params.length>=0'FALSE : 1==2'#cost>100'

stack - 输出当前方法被调用的调用路径

trace - 方法内部调用路径,并输出方法路径上的每个节点上耗时

tt - 方法执行数据的时空隧道,记录下指定方法每次调用的入参和返回信息,并能对这些不同的时间下调用进行观测

tt命令是最有用的命令之一。
如何理解tt呢,相当于将请求快照保存了一份,可以随时调阅。

tt使用

tt -t com.example.controller.RedisController keys
-t, --time-tunnel 时空隧道(相当于快照),这个参数必传

tt -t -n -m com.example.controller.RedisController keys
-n --limits 限制记录条数,如果请求足够多,瞬间可能撑爆内存。
-m --maxMatch 限制匹配类的数量,例如String类,那么匹配的类太多。

-t
tt 命令有很多个主参数,-t 就是其中之一。这个参数的表明希望记录下类 *Test 的 print 方法的每次执行情况。

-n 3
当你执行一个调用量不高的方法时可能你还能有足够的时间用 CTRL+C 中断 tt 命令记录的过程,但如果遇到调用量非常大的方法,瞬间就能将你的 JVM 内存撑爆。

此时你可以通过 -n 参数指定你需要记录的次数,当达到记录次数时 Arthas 会主动中断 tt 命令的记录过程,避免人工操作无法停止的情况。

-m 1
通过 -m 参数指定 Class 匹配的最大数量,防止匹配到的 Class 数量太多导致 JVM 挂起,默认值是 50。

tt 删除

删除单条:

tt -d -i 1001 # 注:删除时-i必填,否则报错(因为不指定索引谁知道该删除哪条呢?)-i, --index <value>
tt -d 1001 # 错误的命令

报错:
Error during processing the command:
java.lang.IllegalArgumentException, message:Time fragment index is expected,
please type -i to specify
, please check $HOME/logs/arthas/arthas.log for more details.

这句说的很明显了,需要指定索引。 至于最后一句是通用的语句,让看日志呢。

删除全部:
tt --delete-all # 这个没报错,全都删除了

tt文档(命令行)
[arthas@22560]$ help ttUSAGE:tt [-d] [--delete-all] [--exclude-class-pattern <value>] [-x <value>] [-h] [-i <value>] [-n <value>] [-l] [--listenerId <value>][-m <value>] [-p] [-E] [--replay-interval <value>] [--replay-times <value>] [-s <value>] [-M <value>] [-t] [-v] [-w <value>] [class-pattern] [method-pattern] [condition-express]SUMMARY:Time TunnelThe express may be one of the following expression (evaluated dynamically):target : the objectclazz : the object's classmethod : the constructor or methodparams : the parameters array of methodparams[0..n] : the element of parameters arrayreturnObj : the returned object of methodthrowExp : the throw exception of methodisReturn : the method ended by returnisThrow : the method ended by throwing exception#cost : the execution time in ms of method invocationEXAMPLES:tt -t *StringUtils isEmptytt -t *StringUtils isEmpty params[0].length==1tt -ltt -i 1000tt -i 1000 -w params[0]tt -i 1000 -ptt -i 1000 -p --replay-times 3 --replay-interval 3000tt -s '{params[0] > 1}' -w '{params}'tt --delete-allWIKI:https://arthas.aliyun.com/doc/ttOPTIONS:-d, --delete                                Delete time fragment specified by index--delete-all                            Delete all the time fragments--exclude-class-pattern <value>         exclude class name pattern, use either '.' or '/' as separator-x, --expand <value>                        Expand level of object (1 by default)-h, --help                                  this help-i, --index <value>                         Display the detailed information from specified time fragment-n, --limits <value>                        Threshold of execution times, default value 100-l, --list                                  List all the time fragments--listenerId <value>                    The special listenerId-m, --maxMatch <value>                      The maximum of matched class.-p, --play                                  Replay the time fragment specified by index-E, --regex                                 Enable regular expression to match (wildcard matching by default)--replay-interval <value>               replay interval  for  play tt with option r greater than 1--replay-times <value>                  execution times when play tt-s, --search-express <value>                Search-expression, to search the time fragments by ognl express.The structure of 'advice' like conditional expression-M, --sizeLimit <value>                     Upper size limit in bytes for the result (10 * 1024 * 1024 by default)-t, --time-tunnel                           Record the method invocation within time fragments-v, --verbose                               Enables print verbose information, default value false.-w, --watch-express <value>                 watch the time fragment by ognl express.Examples:paramsparams[0]'params[0]+params[1]''{params[0], target, returnObj}'returnObjthrowExptargetclazzmethod<class-pattern>                             Path and classname of Pattern Matching<method-pattern>                            Method of Pattern Matching<condition-express>                         Conditional expression in ognl style, for example:TRUE  : 1==1TRUE  : trueFALSE : falseTRUE  : 'params.length>=0'FALSE : 1==2'#cost>100'

watch - 方法执行数据观测

watch主要用于监控查看方法的参数等。
测试需要这么测。
1、先执行命令监控。
2、再调用该方法,上面的监控就会打印指定的输出。

怎么感觉这个功能日志就可以做到呢?

watch例子

监控所有参数:

watch com.example.controller.RedisController keys "params"
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 85 ms, listenerId: 8当方法到达后,输出内容:
method=com.example.controller.RedisController.keys location=AtExit
ts=2024-06-27 14:28:39; [cost=34.9303ms] result=@Object[][@RedisMapRequest[RedisMapRequest(key=set1, sonKey=null, sonValue=null, map=null)],
]

监控第一个参数:

watch com.example.controller.RedisController keys "params[0]"  # 第一个参数

监控参数的size:
watch com.taobao.container.Test test "params[0].size()"

那么问题来了,如何监控返回结果?
这3个分别表示入参,目标,返回结果。

{params, target, returnObj}

3个参数一起写,只会输出第三个参数,所以就写一个吧:
watch com.example.controller.RedisController keys "params, target, returnObj" # 3个都写

watch com.example.controller.RedisController keys "returnObj" # 只写一个

watch target例子

watch com.example.controller.RedisController keys "target" # target

[arthas@22560]$ watch com.example.controller.RedisController keys "target"
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 88 ms, listenerId: 15返回结果:
method=com.example.controller.RedisController.keys location=AtExit
ts=2024-06-27 15:04:31; [cost=25.5637ms] result=@RedisController[age=@Integer[2],logger=@Logger[Logger[com.example.controller.RedisController]],redisTemplate=@RedisTemplate[org.springframework.data.redis.core.RedisTemplate@5b4f914],
]

target会返回方法及所属磊信息。

watch例子2
watch文档(界面)

watch 的参数比较多,主要是因为它能在 4 个不同的场景观察对象。

参数名称参数说明
class-pattern类名表达式匹配
method-pattern函数名表达式匹配
express观察表达式,默认值:{params, target, returnObj}
condition-express条件表达式
[b]函数调用之前观察
[e]函数异常之后观察
[s]函数返回之后观察
[f]函数结束之后(正常返回和异常返回)观察
[E]开启正则表达式匹配,默认为通配符匹配
[x:]指定输出结果的属性遍历深度,默认为 1,最大值是 4
[m <arg>]指定 Class 最大匹配数量,默认值为 50。长格式为[maxMatch <arg>]

这里重点要说明的是观察表达式,观察表达式的构成主要由 ognl 表达式组成,所以你可以这样写"{params,returnObj}",只要是一个合法的 ognl 表达式,都能被正常支持。

观察的维度也比较多,主要体现在参数 advice 的数据结构上。Advice 参数最主要是封装了通知节点的所有信息。请参考表达式核心变量中关于该节点的描述。

特殊用法请参考:https://github.com/alibaba/arthas/issues/71
OGNL 表达式官网:https://commons.apache.org/proper/commons-ognl/language-guide.html

watch文档(命令行)

help watch。

[arthas@22560]$ help watchUSAGE:watch [-b] [-e] [--exclude-class-pattern <value>] [-x <value>] [-f] [-h] [-n <value>] [--listenerId <value>] [-m <value>] [-E] [-M <value>] [-s] [-v] class-pattern method-pattern [express] [condition-express]SUMMARY:Display the input/output parameter, return object, and thrown exception of specified method invocationThe express may be one of the following expression (evaluated dynamically):target : the objectclazz : the object's classmethod : the constructor or methodparams : the parameters array of methodparams[0..n] : the element of parameters arrayreturnObj : the returned object of methodthrowExp : the throw exception of methodisReturn : the method ended by returnisThrow : the method ended by throwing exception#cost : the execution time in ms of method invocationExamples:watch org.apache.commons.lang.StringUtils isBlankwatch org.apache.commons.lang.StringUtils isBlank '{params, target, returnObj, throwExp}' -x 2watch *StringUtils isBlank params[0] params[0].length==1watch *StringUtils isBlank params '#cost>100'watch -f *StringUtils isBlank paramswatch *StringUtils isBlank params[0]watch -E -b org\.apache\.commons\.lang\.StringUtils isBlank params[0]watch javax.servlet.Filter * --exclude-class-pattern com.demo.TestFilterwatch OuterClass$InnerClassWIKI:https://arthas.aliyun.com/doc/watchOPTIONS:-b, --before                                Watch before invocation-e, --exception                             Watch after throw exception--exclude-class-pattern <value>         exclude class name pattern, use either '.' or '/' as separator-x, --expand <value>                        Expand level of object (1 by default), the max value is 4-f, --finish                                Watch after invocation, enable by default-h, --help                                  this help-n, --limits <value>                        Threshold of execution times--listenerId <value>                    The special listenerId-m, --maxMatch <value>                      The maximum of matched class.-E, --regex                                 Enable regular expression to match (wildcard matching by default)-M, --sizeLimit <value>                     Upper size limit in bytes for the result (10 * 1024 * 1024 by default)-s, --success                               Watch after successful invocation-v, --verbose                               Enables print verbose information, default value false.<class-pattern>                             The full qualified class name you want to watch<method-pattern>                            The method name you want to watch<express>                                   The content you want to watch, written by ognl. Default value is '{params, target, returnObj}'Examples:paramsparams[0]'params[0]+params[1]''{params[0], target, returnObj}'returnObjthrowExptargetclazzmethod<condition-express>                         Conditional expression in ognl style, for example:TRUE  : 1==1TRUE  : trueFALSE : falseTRUE  : 'params.length>=0'FALSE : 1==2'#cost>100'

相关文章:

arthas监控工具笔记(二)monior等

文章目录 monitor/watch/trace 相关monitormonitor例子monitor -c <value>monitor -m <vaule>monitor 条件表达式monitor -b monitor文档(界面描述)monitor文档(help) stack - 输出当前方法被调用的调用路径trace - 方法内部调用路径&#xff0c;并输出方法路径上的…...

【mybatis】mybatis-plus中主键生成策略

1、简介 MyBatis-Plus 中的主键生成策略是一个关键特性&#xff0c;它决定了如何为新插入的行生成唯一标识符&#xff08;即主键&#xff09;。MyBatis-Plus 提供了多种主键生成策略&#xff0c;以满足不同场景下的需求。 2、常见主键生成策略 1. AUTO&#xff08;数据库ID自…...

模型情景制作-如何制作棕榈树

夏天&#xff0c;沙滩&#xff0c;海景&#xff0c;棕榈树&#xff0c;外加美女&#xff0c;想象下热带海滨的样子吧 可是口年的上班族没有多少机会去到海滩&#xff0c;肿么办&#xff1f;我们自己DIY一个海滨情景摆在办公桌上吧~~~ 什么什么&#xff1f;棕榈树不会做&#xf…...

# mysql 中文乱码问题分析

mysql 中文乱码问题分析 一、问题分析&#xff1a; MySQL 中文乱码通常是因为字符集设置不正确导致的。MySQL 有多种字符集&#xff0c;如 latin1、utf8、utf8mb4 等&#xff0c;如果在创建数据库、数据表或者字段时没有指定正确的字符集&#xff0c;或者在插入数据时使用了与…...

[小试牛刀-习题练]《计算机组成原理》之指令系统

一、选择题 0.【指令-课本习题】某计算机按字节编址&#xff0c;指令字长固定且只有两种指令格式&#xff0c;其中三地址指令29条&#xff0c;二地址指令107条&#xff0c;每个地址字段为6位&#xff0c;则指令字长至少应该是&#xff08;A&#xff09; A.24位 B. 26位 C. 28位…...

JAVA 实现拍卖框架及拍卖详情流程介绍(包含代码示咧)

本人详解 作者:王文峰,参加过 CSDN 2020年度博客之星,《Java王大师王天师》 公众号:JAVA开发王大师,专注于天道酬勤的 Java 开发问题中国国学、传统文化和代码爱好者的程序人生,期待你的关注和支持!本人外号:神秘小峯 山峯 转载说明:务必注明来源(注明:作者:王文峰…...

力扣1177.构建回文串检测

力扣1177.构建回文串检测 因为子串可以重新排序 因此考虑一下什么情况需要替换字母1.当前有一个字母的数量为奇数 需要替换的次数为0 2.当前有二个字母的数量为奇数 需要替换的次数为1 (奇数个a 奇数个b 需要将b -> a) 3.当前有三个字母的数量为奇数 需要替换的次数为1 4.当…...

Vue跨域获取ip和ip位置城市等归属地信息

由于端口设置与查询服务器不一致&#xff0c;所以不能直接从ip138网上抓取&#xff0c;只能跨域查询。实现跨域查询&#xff0c;简单的方法是使用jsonp方式&#xff0c;只支持get请求&#xff0c;同时也需要查询的服务器支持jsonp。这时找到了腾讯位置服务。参考文章&#xff0…...

缺失的第一个正数

给你一个未排序的整数数组 nums &#xff0c;请你找出其中没有出现的最小的正整数。 请你实现时间复杂度为 O(n) 并且只使用常数级别额外空间的解决方案。 示例 1&#xff1a; 输入&#xff1a;nums [1,2,0] 输出&#xff1a;3 解释&#xff1a;范围 [1,2] 中的数字都在数组…...

mac 上 Docker Desktop的免费开源的替代工具Colima

当谈到在macOS上运行容器时&#xff0c;Docker长期以来一直是首选。但是&#xff0c;必须解决使用适用于macOS的Docker Desktop时出现的一些限制&#xff0c;特别是对于大中型公司&#xff0c;最大的问题是需要购买许可证。另外&#xff0c;macOS 版Docker Desktop的性能问题也…...

C语言 -- 函数

C语言 -- 函数 1. 函数的概念2. 库函数2.1 标准库和头文件2.2 库函数的使用方法2.2.1 功能2.2.2 头文件包含2.2.3 实践2.2.4 库函数文档的一般格式 3. 自定义函数3.1 函数的语法形式3.2 函数的举例 4. 形参和实参4.1 实参4.2 形参4.3 实参和形参的关系 5. return 语句6. 数组做…...

Cesium 立式雷达扫描

Cesium 立式雷达扫描 自定义 Primitive 实现支持水平和垂直交替扫描...

Oracle HTTP Server(OHS)与Oracle数据库的紧密绑定

Oracle HTTP Server&#xff08;OHS&#xff09;与Oracle数据库的紧密绑定通常是通过一系列的配置和集成步骤来实现的。以下是这些步骤的详细归纳&#xff0c;包括必要的分点表示和参考信息&#xff1a; 一、安装和配置Oracle HTTP Server 安装OHS&#xff1a; 在安装Oracle…...

mmcv安装失败及解决方案

假如想安装的版本是mmcv1.4.0, 但是pip install mmcv1.4.0总是失败&#xff0c;若是直接pip install mmcv会安装成功&#xff0c;但是安装的就是最新版本&#xff0c;后面代码跑起来还会报错&#xff0c;怎么办呢&#xff1f; 接下来分享一个mmcv指定版本安装的方式。 网页&a…...

国产强大免费WAF, 社区版雷池动态防护介绍

雷池WAF&#xff0c;基于智能语义分析的下一代 Web 应用防火墙 使用情况 我司于2023年4月23日对雷池进行测试&#xff0c;测试一个月后&#xff0c;于2023年5月24日对雷池进行正式切换&#xff0c;此时版本为1.5.1。 里程碑纪念 后续一直跟随雷池进行版本升级&#xff0c;当前…...

【Django】网上蛋糕项目商城-首页

概念 本文在上一文章搭建完数据库&#xff0c;以及创建好项目之后&#xff0c;以及前端静态文件后&#xff0c;对项目的首页功能开发。 后端代码编写 在views.py文件中创建方法&#xff0c;连接数据库&#xff0c;并获取首页需要的数据 def getGoodsList(type):# 获取所有横…...

Vue 父子页面使用指南

Vue3父子页面使用指南 Vue3作为一种现代化的前端框架&#xff0c;提供了强大的组件化功能&#xff0c;使得页面开发更加模块化和可维护。本文将深入探讨Vue3中父子页面的使用方法&#xff0c;包括如何传递参数、父组件如何调用子组件的方法&#xff0c;以及父子页面的加载原理…...

TVBox自定义配置+软件密码版本

apk地址 : https://gitee.com/wheat-wheat/kekeda-duck-apk 1、安装安卓SDK Android SDK Windows 安装及环境配置教程_sdk manager windows-CSDN博客 修改点: 基础配置: java版本:...

Java单体架构项目_云霄外卖-特殊点

项目介绍&#xff1a; 定位&#xff1a; 专门为餐饮企业&#xff08;餐厅、饭店&#xff09;定制的一款软件商品 分为&#xff1a; 管理端&#xff1a;外卖商家使用 用户端&#xff08;微信小程序&#xff09;&#xff1a;点餐用户使用。 功能架构&#xff1a; &#xff08…...

一文搞懂 java 线程池:ScheduledThreadPool 和 WorkStealingPool 原理

你好&#xff0c;我是 shengjk1&#xff0c;多年大厂经验&#xff0c;努力构建 通俗易懂的、好玩的编程语言教程。 欢迎关注&#xff01;你会有如下收益&#xff1a; 了解大厂经验拥有和大厂相匹配的技术等 希望看什么&#xff0c;评论或者私信告诉我&#xff01; 文章目录 一…...

【大模型RAG】拍照搜题技术架构速览:三层管道、两级检索、兜底大模型

摘要 拍照搜题系统采用“三层管道&#xff08;多模态 OCR → 语义检索 → 答案渲染&#xff09;、两级检索&#xff08;倒排 BM25 向量 HNSW&#xff09;并以大语言模型兜底”的整体框架&#xff1a; 多模态 OCR 层 将题目图片经过超分、去噪、倾斜校正后&#xff0c;分别用…...

FFmpeg 低延迟同屏方案

引言 在实时互动需求激增的当下&#xff0c;无论是在线教育中的师生同屏演示、远程办公的屏幕共享协作&#xff0c;还是游戏直播的画面实时传输&#xff0c;低延迟同屏已成为保障用户体验的核心指标。FFmpeg 作为一款功能强大的多媒体框架&#xff0c;凭借其灵活的编解码、数据…...

STM32+rt-thread判断是否联网

一、根据NETDEV_FLAG_INTERNET_UP位判断 static bool is_conncected(void) {struct netdev *dev RT_NULL;dev netdev_get_first_by_flags(NETDEV_FLAG_INTERNET_UP);if (dev RT_NULL){printf("wait netdev internet up...");return false;}else{printf("loc…...

ESP32读取DHT11温湿度数据

芯片&#xff1a;ESP32 环境&#xff1a;Arduino 一、安装DHT11传感器库 红框的库&#xff0c;别安装错了 二、代码 注意&#xff0c;DATA口要连接在D15上 #include "DHT.h" // 包含DHT库#define DHTPIN 15 // 定义DHT11数据引脚连接到ESP32的GPIO15 #define D…...

微信小程序 - 手机震动

一、界面 <button type"primary" bindtap"shortVibrate">短震动</button> <button type"primary" bindtap"longVibrate">长震动</button> 二、js逻辑代码 注&#xff1a;文档 https://developers.weixin.qq…...

postgresql|数据库|只读用户的创建和删除(备忘)

CREATE USER read_only WITH PASSWORD 密码 -- 连接到xxx数据库 \c xxx -- 授予对xxx数据库的只读权限 GRANT CONNECT ON DATABASE xxx TO read_only; GRANT USAGE ON SCHEMA public TO read_only; GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_only; GRANT EXECUTE O…...

CMake 从 GitHub 下载第三方库并使用

有时我们希望直接使用 GitHub 上的开源库,而不想手动下载、编译和安装。 可以利用 CMake 提供的 FetchContent 模块来实现自动下载、构建和链接第三方库。 FetchContent 命令官方文档✅ 示例代码 我们将以 fmt 这个流行的格式化库为例,演示如何: 使用 FetchContent 从 GitH…...

多模态大语言模型arxiv论文略读(108)

CROME: Cross-Modal Adapters for Efficient Multimodal LLM ➡️ 论文标题&#xff1a;CROME: Cross-Modal Adapters for Efficient Multimodal LLM ➡️ 论文作者&#xff1a;Sayna Ebrahimi, Sercan O. Arik, Tejas Nama, Tomas Pfister ➡️ 研究机构: Google Cloud AI Re…...

QT: `long long` 类型转换为 `QString` 2025.6.5

在 Qt 中&#xff0c;将 long long 类型转换为 QString 可以通过以下两种常用方法实现&#xff1a; 方法 1&#xff1a;使用 QString::number() 直接调用 QString 的静态方法 number()&#xff0c;将数值转换为字符串&#xff1a; long long value 1234567890123456789LL; …...

算法笔记2

1.字符串拼接最好用StringBuilder&#xff0c;不用String 2.创建List<>类型的数组并创建内存 List arr[] new ArrayList[26]; Arrays.setAll(arr, i -> new ArrayList<>()); 3.去掉首尾空格...