fisco bcos用caliper0.2.0进行压力测试的安装配置
一、前期环境
1. 硬件
需要外网权限
2. 操作系统
版本要求:Ubuntu >= 16.04, CentOS >= 7, MacOS >= 10.14
3. 基础软件
python 2.7,make,g++,gcc,git
sudo apt install python2.7 make g++ gcc git curl
git config --global url.git://github.com/.insteadOf https://github.com/
4. NodeJS
版本要求:
NodeJS 8 (LTS), 9, 或 10 (LTS),Caliper尚未在更高的NodeJS版本中进行过验证。
安装指南:
建议使用nvm(Node Version Manager)安装,nvm的安装方式如下:
# 安装nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash# 若出现因网络问题导致长时间下载失败,可尝试以下命令
curl -o- https://gitee.com/mirrors/nvm/raw/v0.33.2/install.sh | bash# 加载nvm配置
source ~/.$(basename $SHELL)rc
# 安装Node.js 8
nvm install 8
# 使用Node.js 8
nvm use 8
5. Docker
# 更新包索引
sudo apt-get update
# 安装基础依赖库
sudo apt-get install \apt-transport-https \ca-certificates \curl \gnupg-agent \software-properties-common
# 添加Docker官方GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# 添加docker仓库
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# 更新包索引
sudo apt-get update
# 安装Docker
sudo apt-get install docker-ce docker-ce-cli containerd.io
#查看Docker版本
docker --version
#添加docker用户组
sudo groupadd docker
#将当前用户添加至docker用户组
sudo gpasswd -a $USER docker
#更新docker用户组
newgrp docker
# 重启Docker服务
sudo service docker restart
# 验证Docker是否已经启动
sudo systemctl status docker
6. Docker Compose
版本要求:>= 1.22.0
安装指南:
#有时候连接错误,多试几次就好了
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
#查看docker-compose版本
docker-compose -v
二、Caliper部署
1. 部署
#建立一个工作目录
mkdir benchmarks && cd benchmarks
#对NPM项目进行初始化
npm init -y
#安装caliper-cli
npm install --only=prod @hyperledger/caliper-cli@0.2.0
#验证caliper-cli安装成功
npx caliper --version
需要改三个配置文件
/home/echo/benchmarks/node_modules/@hyperledger/caliper-fisco-bcos/lib/fiscoBcos.js
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/'use strict';const {BlockchainInterface,CaliperUtils
} = require('@hyperledger/caliper-core');
const installSmartContractImpl = require('./installSmartContract');
const invokeSmartContractImpl = require('./invokeSmartContract');
const generateRawTransactionImpl = require('./generateRawTransactions');
const sendRawTransactionImpl = require('./sendRawTransactions');
const Color = require('./common').Color;
const commLogger = CaliperUtils.getLogger('fiscoBcos.js');/*** Implements {BlockchainInterface} for a FISCO BCOS backend.*/
class FiscoBcos extends BlockchainInterface {/*** Create a new instance of the {FISCO BCOS} class.* @param {string} config_path The absolute path of the FISCO BCOS network configuration file.* @param {string} workspace_root The absolute path to the root location for the application configuration files.*/constructor(config_path, workspace_root) {super(config_path);this.bcType = 'fisco-bcos';this.workspaceRoot = workspace_root;this.fiscoBcosSettings = CaliperUtils.parseYaml(this.configPath)['fisco-bcos'];if (this.fiscoBcosSettings.network && this.fiscoBcosSettings.network.authentication) {for (let k in this.fiscoBcosSettings.network.authentication) {this.fiscoBcosSettings.network.authentication[k] = CaliperUtils.resolvePath(this.fiscoBcosSettings.network.authentication[k], workspace_root);}}}/*** Initialize the {FISCO BCOS} object.* @async* @return {Promise<object>} The promise for the result of the execution.*/async init() {return Promise.resolve();}/*** Deploy the smart contract specified in the network configuration file to all nodes.* @async*/async installSmartContract() {const fiscoBcosSettings = this.fiscoBcosSettings;try {await installSmartContractImpl.run(fiscoBcosSettings, this.workspaceRoot);} catch (error) {commLogger.error(Color.error(`FISCO BCOS smart contract install failed: ${(error.stack ? error.stack : error)}`));throw error;}}/*** Get a context for subsequent operations* 'engine' attribute of returned context object must be reserved for benchmark engine to extend the context* engine = {* submitCallback: callback which must be called once new transaction(s) is submitted, it receives a number argument which tells how many transactions are submitted* }* @param {String} name name of the context* @param {Object} args adapter specific arguments* @param {Integer} clientIdx the client index* @return {Promise<object>} The promise for the result of the execution.*/async getContext(name, args, clientIdx) {return Promise.resolve();}/*** Release a context as well as related resources* @param {Object} context adapter specific object* @return {Promise<object>} The promise for the result of the execution.*/async releaseContext(context) {return Promise.resolve();}/*** Invoke the given smart contract according to the specified options. Multiple transactions will be generated according to the length of args.* @param {object} context The FISCO BCOS context returned by {getContext}.* @param {string} contractID The name of the smart contract.* @param {string} contractVer The version of the smart contract.* @param {Array} args Array of JSON formatted arguments for transaction(s). Each element contains arguments (including the function name) passing to the smart contract. JSON attribute named transaction_type is used by default to specify the function name. If the attribute does not exist, the first attribute will be used as the function name.* @param {number} timeout The timeout to set for the execution in seconds.* @return {Promise<object>} The promise for the result of the execution.*/async invokeSmartContract(context, contractID, contractVer, args, timeout) {let promises = [];try {args.forEach((arg) => {let fcn = null;let fcArgs = [];for (let key in arg) {if (key === 'transaction_type') {fcn = arg[key].toString();} else {fcArgs.push(arg[key].toString());}}promises.push(invokeSmartContractImpl.run(context, this.fiscoBcosSettings, contractID, fcn, fcArgs, this.workspaceRoot));});return await Promise.all(promises);} catch (error) {commLogger.error(Color.error(`FISCO BCOS smart contract invoke failed: ${(error.stack ? error.stack : JSON.stringify(error))}`));throw error;}}/*** Query state from the ledger* @param {Object} context The FISCO BCOS context returned by {getContext}* @param {String} contractID Identity of the contract* @param {String} contractVer Version of the contract* @param {String} key lookup key* @param {String} fcn The smart contract query function name* @return {Promise<object>} The result of the query.*/async queryState(context, contractID, contractVer, key, fcn) {try {return invokeSmartContractImpl.run(context, this.fiscoBcosSettings, contractID, fcn, key, this.workspaceRoot, true);} catch (error) {commLogger.error(Color.error(`FISCO BCOS smart contract query failed: ${(error.stack ? error.stack : error)}`));throw error;}}/*** Generate an raw transaction and store in local file* @param {Object} context The FISCO BCOS context returned by {getContext}* @param {String} contractID Identity of the contract* @param {Object} arg Arguments of the transaction* @param {String} file File path which will be used to store then transaction* @return {TaskStatus} Indicates whether the transaction is written to the file successfully or not*/async generateRawTransaction(context, contractID, arg, file) {return generateRawTransactionImpl.run(this.fiscoBcosSettings, this.workspaceRoot, context, contractID, arg, file);}/*** Send raw transactions* @param {Object} context The FISCO BCOS context returned by {getContext}* @param {Array} transactions List of raw transactions* @return {Promise} The promise for the result of the execution*/async sendRawTransaction(context, transactions) {return sendRawTransactionImpl.run(this.fiscoBcosSettings, context, transactions);}
}module.exports = FiscoBcos;
/home/echo/benchmarks/node_modules/@hyperledger/caliper-fisco-bcos/lib/channelPromise.js
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/'use strict';const tls = require('tls');
const fs = require('fs');
const net = require('net');
const uuidv4 = require('uuid/v4');
const events = require('events');/*** NetworkError exception class thrown in socket connection*/
class NetworkError extends Error {/**** @param {String} msg exception message*/constructor(msg) {super(msg);this.name = 'NetworkError';}
}let emitters = new Map();
let buffers = new Map();
let sockets = new Map();
let lastBytesRead = new Map();/*** Parse response returned by node* @param {Buffer} response Node's response*/
function parseResponse(response) {let seq = response.slice(6, 38).toString();let result = JSON.parse(response.slice(42).toString());let emitter = emitters.get(seq);if(!emitter) {//Stale message receievedreturn;}emitter = emitter.emitter;if (emitter) {let readOnly = Object.getOwnPropertyDescriptor(emitter, 'readOnly').value;if (readOnly) {if (result.error || result.result !== undefined ) {emitter.emit('gotresult', result);}} else {if (result.error || result.status || (result.result && result.result.status)) {emitter.emit('gotresult', result);} else {if (!result.result) {throw new NetworkError(`unknown message receieved, seq=${seq}, data=${response.toString()}`);}}}} else {throw new NetworkError(`unknown owner message receieved, seq=${seq}, data=${response.toString()}`);}
}/*** Create a new TLS socket* @param {String} ip IP of channel server* @param {Number} port Port of channel server* @param {Object} authentication A JSON object contains certificate file path, private key file path and CA file path* @return {TLSSocket} A new TLS socket*/
function createNewSocket(ip, port, authentication) {let secureContextOptions = {key: fs.readFileSync(authentication.key),cert: fs.readFileSync(authentication.cert),ca: fs.readFileSync(authentication.ca),ecdhCurve: 'secp256k1',};let secureContext = tls.createSecureContext(secureContextOptions);let socket = new net.Socket();socket.connect(port, ip);let clientOptions = {rejectUnauthorized: false,secureContext: secureContext,socket: socket};let tlsSocket = tls.connect(clientOptions);tlsSocket.on('error', function (error) {throw new Error(error);});let socketID = `${ip}:${port}`;lastBytesRead.set(socketID, 0);tlsSocket.on('data', function (data) {let response = null;if (data instanceof Buffer) {response = data;}else {response = Buffer.from(data, 'ascii');}if (!buffers.has(socketID)) {// First time to read data from this socketlet expectedLength = null;if (tlsSocket.bytesRead - lastBytesRead.get(socketID) >= 4) {expectedLength = response.readUIntBE(0, 4);}if (!expectedLength || tlsSocket.bytesRead < lastBytesRead.get(socketID) + expectedLength) {buffers.set(socketID, {expectedLength: expectedLength,buffer: response});} else {lastBytesRead.set(socketID, lastBytesRead.get(socketID) + expectedLength);parseResponse(response);buffers.delete(socketID);}} else {// Multiple readinglet cache = buffers.get(socketID);cache.buffer = Buffer.concat([cache.buffer, response]);if (!cache.expectedLength && tlsSocket.bytesRead - lastBytesRead.get(socketID) >= 4) {cache.expectedLength = cache.buffer.readUIntBE(0, 4);}if (cache.expectedLength && tlsSocket.bytesRead - lastBytesRead.get(socketID) >= cache.expectedLength) {lastBytesRead.set(socketID, lastBytesRead.get(socketID) + cache.expectedLength);parseResponse(buffers.get(socketID).buffer);buffers.delete(socketID);}}});return tlsSocket;
}/*** Prepare the data which will be sent to channel server* @param {String} data JSON string of load* @return {Object} UUID and packaged data*/
function packageData(data) {const headerLength = 4 + 2 + 32 + 4;let length = Buffer.alloc(4);length.writeUInt32BE(headerLength + data.length);let type = Buffer.alloc(2);type.writeUInt16BE(0x12);let uuid = uuidv4();uuid = uuid.replace(/-/g, '');let seq = Buffer.from(uuid, 'ascii');let result = Buffer.alloc(4);result.writeInt32BE(0);let msg = Buffer.from(data, 'ascii');return {'uuid': uuid,'packagedData': Buffer.concat([length, type, seq, result, msg])};
}/*** Clear context when a message got response or timeout* @param {String} uuid The ID of an `channelPromise`request*/
function clearContext(uuid) {clearTimeout(emitters.get(uuid).timer);emitters.delete(uuid);buffers.delete(uuid);
}/*** Return channel promise for a request* @param {Object} node A JSON object which contains IP and port configuration of channel server* @param {Object} authentication A JSON object contains certificate file path, private key file path and CA file path* @param {String} data JSON string of load* @param {Number} timeout Timeout to wait response* @param {Boolean} readOnly Is this request read-only?* @return {Promise} a promise which will be resolved when the request is satisfied*/
function channelPromise(node, authentication, data, timeout, readOnly = false) {let ip = node.ip;let port = node.channelPort;let connectionID = `${ip}${port}`;if (!sockets.has(connectionID)) {let newSocket = createNewSocket(ip, port, authentication);newSocket.unref();sockets.set(connectionID, newSocket);}let tlsSocket = sockets.get(connectionID);let dataPackage = packageData(JSON.stringify(data));let uuid = dataPackage.uuid;tlsSocket.socketID = uuid;let packagedData = dataPackage.packagedData;let channelPromise = new Promise(async (resolve, reject) => {let eventEmitter = new events.EventEmitter();Object.defineProperty(eventEmitter, 'readOnly', {value: readOnly,writable: false,configurable: false,enumerable: false});eventEmitter.on('gotresult', (result) => {clearContext(uuid);if (result.error) {reject(result);} else {resolve(result);}return; // This `return` is not necessary, but it may can avoid future trap});eventEmitter.on('timeout', () => {clearContext(uuid);reject({ 'error': 'timeout' });return; // This `return` is not necessary, but it may can avoid future trap});emitters.set(uuid, {emitter: eventEmitter,timer: setTimeout(() => {eventEmitter.emit('timeout');}, timeout)});tlsSocket.write(packagedData);});return channelPromise;
}module.exports = channelPromise;
/home/echo/benchmarks/node_modules/@hyperledger/caliper-fisco-bcos/lib/web3lib/web3sync.js
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/'use strict';const uuidv4 = require('uuid/v4');
const utils = require('./utils');
const Transaction = require('./transactionObject').Transaction;/*** Generate a random number via UUID* @return {Number} random number*/
function genRandomID() {let uuid = uuidv4();uuid = '0x' + uuid.replace(/-/g, '');return uuid;
}/*** Sign a transaction with private key and callback* @param {String} txData transaction data* @param {Buffer} privKey private key* @param {callback} callback callback function* @return {String} signed transaction data*/
function signTransaction(txData, privKey, callback) {let tx = new Transaction(txData);let privateKey = Buffer.from(privKey, 'hex');tx.sign(privateKey);// Build a serialized hex version of the txlet serializedTx = '0x' + tx.serialize().toString('hex');if (callback !== null) {callback(serializedTx);} else {return serializedTx;}
}/*** get transaction data* @param {String} func function name* @param {Array} params params* @return {String} transaction data*/
function getTxData(func, params) {let r = /^\w+\((.*)\)$/g.exec(func);let types = [];if (r[1]) {types = r[1].split(',');}return utils.encodeTxData(func, types, params);
}/*** get signed transaction data* @param {Number} groupId ID of the group where this transaction will be sent to* @param {Buffer} account user account* @param {Buffer} privateKey private key* @param {Buffer} to target address* @param {String} func function name* @param {Array} params params* @param {Number} blockLimit block limit* @return {String} signed transaction data*/
function getSignTx(groupId, account, privateKey, to, func, params, blockLimit) {let txData = getTxData(func, params);let postdata = {data: txData,from: account,to: to,gas: 1000000,randomid: genRandomID(),blockLimit: blockLimit,chainId: 1,groupId: groupId,extraData: '0x0'};return signTransaction(postdata, privateKey, null);
}/*** get signed deploy tx* @param {Number} groupId ID of the group where this transaction will be sent to* @param {Buffer} account user account* @param {Buffer} privateKey private key* @param {Buffer} bin contract bin* @param {Number} blockLimit block limit* @return {String} signed deploy transaction data*/
function getSignDeployTx(groupId, account, privateKey, bin, blockLimit) {let txData = bin.indexOf('0x') === 0 ? bin : ('0x' + bin);let postdata = {data: txData,from: account,to: null,gas: 1000000,randomid: genRandomID(),blockLimit: blockLimit,chainId: 1,groupId: groupId,extraData: '0x0'};return signTransaction(postdata, privateKey, null);
}module.exports.getSignDeployTx = getSignDeployTx;
module.exports.signTransaction = signTransaction;
module.exports.getSignTx = getSignTx;
module.exports.getTxData = getTxData;
进入/home/echo/benchmarks/node_modules/@hyperledger/caliper-fisco-bcos目录,编辑该目录下的package.json文件,在"dependencies"中添加一项"secp256k1": "^3.8.0"
,随后在该目录下执行npm i secp256k1@3.0.0
2. 绑定
npx caliper bind --caliper-bind-sut fisco-bcos --caliper-bind-sdk latest
3. 运行基准测试
#拉取代码
git clone https://gitee.com/vita-dounai/caliper-benchmarks.git
#测试helloworld合约
npx caliper benchmark run --caliper-workspace caliper-benchmarks --caliper-benchconfig benchmarks/samples/fisco-bcos/helloworld/config.yaml --caliper-networkconfig networks/fisco-bcos/4nodes1group/fisco-bcos.json
#执行Solidity版转账合约测试
npx caliper benchmark run --caliper-workspace caliper-benchmarks --caliper-benchconfig benchmarks/samples/fisco-bcos/transfer/solidity/config.yaml --caliper-networkconfig networks/fisco-bcos/4nodes1group/fisco-bcos.json
#执行预编译版转账合约测试
npx caliper benchmark run --caliper-workspace caliper-benchmarks --caliper-benchconfig benchmarks/samples/fisco-bcos/transfer/precompiled/config.yaml --caliper-networkconfig networks/fisco-bcos/4nodes1group/fisco-bcos.json
相关文章:

fisco bcos用caliper0.2.0进行压力测试的安装配置
一、前期环境 1. 硬件 需要外网权限 2. 操作系统 版本要求:Ubuntu > 16.04, CentOS > 7, MacOS > 10.14 3. 基础软件 python 2.7,make,g,gcc,git sudo apt install python2.7 make g gcc git curl git confi…...

正在进行 | 用友企业数智化财务峰会落地广州 高能不断
3月28日,以「智能会计 价值财务」为主题的“2023企业数智化财务创新峰会”登陆广州。 此次用友企业数智化财务创新峰会,邀请了知名院校的专家学者、央国企等大型企业财务数智化领路人以及羊城权威媒体,近千人相约广州越秀国际会议中心,深度聚焦大型企业财务数智化创新应用…...

uniapp - APP云打包、蒲公英平台发布APP的步骤
一、uniapp 云打包 1、注册 dcloud 开发者 首先需要注册一个 dcloud 开发者的账号 dcloud开发者中心:登录 (dcloud.net.cn) 根据流程注册即可。 2、云打包(已安卓为例) 项目创建完成后,查看 dcloud 开发者中心,看是否…...
reposync命令详解--reposync同步aliyunyum库到本地
参考: reposync - 命令 - -桃枝夭夭- - 博客园 0. 简介 reposync 命令简单来说就是可以把指定外网源(repo id)的包同步到本地文件中 1. 安装 reposync 命令 [rootV10SP1-1 ~]# yum install -y dnf-plugins-core2. 常用选项以及参数 选项含义-c [fil…...

OCR之论文笔记TrOCR
文章目录TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models一. 简介二. TrOCR2.1. Encoder2.2 Decoder2.3 Model Initialiaztion2.4 Task Pipeline2.5 Pre-training2.6 Fine-tuning2.7 Data Augmentation三. 实验3.1 Data3.2 Settings3.2 Resul…...

雷电4模拟器安装xposed框架(2022年)
别问我都2202年了为什么还在用雷电4安卓7。我特么哪知道Xposed的相关资料这么难找啊,只能搜到一些老旧的资料,尝试在老旧的平台上实现了。 最初的Xposed框架现在已经停止更新了,只支持到安卓8。如果要在更高版本的安卓系统上使用Xposed得看看…...

微信小程序支付完整流程(前端)
微信小程序中,常见付款给商家的场景,下面列出企业小程序中,从0起步完整微信支付流程。 一,注册微信支付商户号(由上级或法人注册) 接入微信支付 - 微信商户平台 此商户号,需要由主管及更上级领导…...

设置鼠标右键打开方式,添加IDEA的打开方式
一、问题描述 已下载IDEA,但是右键打开之前保存的项目文件,无法显示以IDEA方式打开。 二、解决步骤 1. 打开注册表 winR键输入regedit 2、查找路径为计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell (我找了半天没看到Class…...

LAMP架构之zabbix监控(2):zabbix基础操作
目录 一、zabbix监控节点添加和删除 (1)手动添加 (2)自动添加 (3)按照条件批量添加 (4)使用api工具进行管理 二、针对应用的zabbix监控 一、zabbix监控节点添加和删除 实验说明&a…...

ShareSDK常见问题
QQ-分享报错901111,9001010等 由于QQ现在需要审核后才可以分享(之前分享不需要审核),所以此错误解决方法只需通过腾讯开放平台的审核即可,另外要检查注册好的应用的基本信息,包名、md5签名和Bundle id是不…...

[Spring]一文明白IOC容器和思想
✅作者简介:大家好,我是Philosophy7?让我们一起共同进步吧!🏆 📃个人主页:Philosophy7的csdn博客 🔥系列专栏: 数据结构与算法 👑哲学语录: 承认自己的无知,乃…...

程序人生 | 与足球共舞的火柴人(致敬格拉利什,赋予足球更深的意义)
个人简介 👀个人主页: 前端杂货铺 🙋♂️学习方向: 主攻前端方向,也会涉及到服务端 📃个人状态: 在校大学生一枚,已拿多个前端 offer(秋招) 🚀未…...

MATLAB | R2023a更新了哪些好玩的东西
R2023a来啦!!废话不多说看看新版本有啥有趣的玩意和好玩的特性叭!!把绘图放最前面叭,有图的内容看的人多。。 1 区域填充 可以使用xregion及yregion进行区域填充啦!! x -10:0.25:10; y x.^…...
Python Module — OpenAI ChatGPT API
目录 文章目录目录OpenAI Python SDKopenai.ChatCompletion 模块openai.ChatCompletion.create 函数OpenAI Python SDK 官方文档:https://platform.openai.com/docs/api-reference/introduction OpenAI Python SDK 用于开发与 OpenAI RESTful API 进行交互的客户端…...
Docker学习记录
阅读前请看一下:我是一个热衷于记录的人,每次写博客会反复研读,尽量不断提升博客质量。文章设置为仅粉丝可见,是因为写博客确实花了不少精力。希望互相进步谢谢!! 文章目录阅读前请看一下:我是一…...
Linux-VIM使用
文章目录前言VIM使用1、切换模式2、跳转(1) 跳转到指定行(2) 跳转到首行(3) 跳转到末行3、自动格式化程序4. 大括号对应5. 删除(1)删除一个单词(2)删除光标位置至行尾(3)删除光标位置至行首(4&a…...

Windows安全中心内存完整性无法打开问题的处理方法
Windows11安全中心内存完整性无法打开 今天电脑使用过程中突然看到系统桌面右下角任务栏中 windows安全中心图标出现了警告信息,如下图红框所示: 点击该图标进入windows安全中心的 安全性概览 界面,如下图: 在该界面可以看到出现安…...

在芯片设计行业,从项目的初期到交付,不同的岗位的工程师主要负责什么?
大家都知道在芯片设计行业,项目是至关重要的一环。从项目的初期到交付,不同的岗位的工程师在项目的各环节主要负责什么?他们是怎样配合的?下面看看资深工程师怎么说。 一个项目,从初期到交付的过程是比较漫长的。我们知道最早的时候&#…...

Spring Cloud Alibaba全家桶(七)——Sentinel控制台规则配置
前言 本文小新为大家带来 Sentinel控制台规则配置 相关知识,具体内容包括流控规则(包括:QPS流控规则,并发线程数流控规则),BlockException统一异常处理,流控模式(包括:直…...

mysql-installer安装教程(详细图文)
目录 1.安装 2.配置系统环境变量 3.配置初始化my.ini文件 4.MySQL彻底删除 5.Navicat 安装 1.安装 先去官网下载需要的msi,在这放出官网下载地址下载地址 这里我具体以8.0.28 为安装例子,除了最新版安装界面有些变动以往的都是差不多的。 过去的版本…...
后进先出(LIFO)详解
LIFO 是 Last In, First Out 的缩写,中文译为后进先出。这是一种数据结构的工作原则,类似于一摞盘子或一叠书本: 最后放进去的元素最先出来 -想象往筒状容器里放盘子: (1)你放进的最后一个盘子(…...
前端倒计时误差!
提示:记录工作中遇到的需求及解决办法 文章目录 前言一、误差从何而来?二、五大解决方案1. 动态校准法(基础版)2. Web Worker 计时3. 服务器时间同步4. Performance API 高精度计时5. 页面可见性API优化三、生产环境最佳实践四、终极解决方案架构前言 前几天听说公司某个项…...

基于当前项目通过npm包形式暴露公共组件
1.package.sjon文件配置 其中xh-flowable就是暴露出去的npm包名 2.创建tpyes文件夹,并新增内容 3.创建package文件夹...

IoT/HCIP实验-3/LiteOS操作系统内核实验(任务、内存、信号量、CMSIS..)
文章目录 概述HelloWorld 工程C/C配置编译器主配置Makefile脚本烧录器主配置运行结果程序调用栈 任务管理实验实验结果osal 系统适配层osal_task_create 其他实验实验源码内存管理实验互斥锁实验信号量实验 CMISIS接口实验还是得JlINKCMSIS 简介LiteOS->CMSIS任务间消息交互…...

IT供电系统绝缘监测及故障定位解决方案
随着新能源的快速发展,光伏电站、储能系统及充电设备已广泛应用于现代能源网络。在光伏领域,IT供电系统凭借其持续供电性好、安全性高等优势成为光伏首选,但在长期运行中,例如老化、潮湿、隐裂、机械损伤等问题会影响光伏板绝缘层…...
[Java恶补day16] 238.除自身以外数组的乘积
给你一个整数数组 nums,返回 数组 answer ,其中 answer[i] 等于 nums 中除 nums[i] 之外其余各元素的乘积 。 题目数据 保证 数组 nums之中任意元素的全部前缀元素和后缀的乘积都在 32 位 整数范围内。 请 不要使用除法,且在 O(n) 时间复杂度…...

Maven 概述、安装、配置、仓库、私服详解
目录 1、Maven 概述 1.1 Maven 的定义 1.2 Maven 解决的问题 1.3 Maven 的核心特性与优势 2、Maven 安装 2.1 下载 Maven 2.2 安装配置 Maven 2.3 测试安装 2.4 修改 Maven 本地仓库的默认路径 3、Maven 配置 3.1 配置本地仓库 3.2 配置 JDK 3.3 IDEA 配置本地 Ma…...

初学 pytest 记录
安装 pip install pytest用例可以是函数也可以是类中的方法 def test_func():print()class TestAdd: # def __init__(self): 在 pytest 中不可以使用__init__方法 # self.cc 12345 pytest.mark.api def test_str(self):res add(1, 2)assert res 12def test_int(self):r…...
iOS性能调优实战:借助克魔(KeyMob)与常用工具深度洞察App瓶颈
在日常iOS开发过程中,性能问题往往是最令人头疼的一类Bug。尤其是在App上线前的压测阶段或是处理用户反馈的高发期,开发者往往需要面对卡顿、崩溃、能耗异常、日志混乱等一系列问题。这些问题表面上看似偶发,但背后往往隐藏着系统资源调度不当…...
【SSH疑难排查】轻松解决新版OpenSSH连接旧服务器的“no matching...“系列算法协商失败问题
【SSH疑难排查】轻松解决新版OpenSSH连接旧服务器的"no matching..."系列算法协商失败问题 摘要: 近期,在使用较新版本的OpenSSH客户端连接老旧SSH服务器时,会遇到 "no matching key exchange method found", "n…...