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

JavaScript系列(58)--性能监控系统详解

JavaScript性能监控系统详解 📊

今天,让我们深入探讨JavaScript的性能监控系统。性能监控对于保证应用的稳定性和用户体验至关重要。

性能监控基础概念 🌟

💡 小知识:JavaScript性能监控是指通过收集和分析各种性能指标,来评估和优化应用性能的过程。这包括页面加载时间、资源使用情况、运行时性能等多个方面。

性能指标收集 📈

// 1. 性能指标收集器
class PerformanceCollector {constructor() {this.metrics = new Map();this.observers = new Set();}// 收集页面加载性能collectPageMetrics() {const timing = performance.timing;const metrics = {dnsTime: timing.domainLookupEnd - timing.domainLookupStart,tcpTime: timing.connectEnd - timing.connectStart,ttfb: timing.responseStart - timing.requestStart,domReady: timing.domContentLoadedEventEnd - timing.navigationStart,loadComplete: timing.loadEventEnd - timing.navigationStart};this.metrics.set('page', metrics);this.notifyObservers('page', metrics);}// 收集资源加载性能collectResourceMetrics() {const resources = performance.getEntriesByType('resource');const metrics = resources.map(resource => ({name: resource.name,type: resource.initiatorType,duration: resource.duration,size: resource.transferSize,startTime: resource.startTime}));this.metrics.set('resources', metrics);this.notifyObservers('resources', metrics);}// 收集运行时性能collectRuntimeMetrics() {const metrics = {memory: performance.memory ? {usedJSHeapSize: performance.memory.usedJSHeapSize,totalJSHeapSize: performance.memory.totalJSHeapSize,jsHeapSizeLimit: performance.memory.jsHeapSizeLimit} : null,fps: this.calculateFPS()};this.metrics.set('runtime', metrics);this.notifyObservers('runtime', metrics);}calculateFPS() {let lastTime = performance.now();let frames = 0;let fps = 0;const updateFPS = () => {const now = performance.now();frames++;if (now > lastTime + 1000) {fps = Math.round((frames * 1000) / (now - lastTime));frames = 0;lastTime = now;}requestAnimationFrame(updateFPS);};requestAnimationFrame(updateFPS);return () => fps;}addObserver(observer) {this.observers.add(observer);}removeObserver(observer) {this.observers.delete(observer);}notifyObservers(type, data) {this.observers.forEach(observer => {observer.update(type, data);});}
}// 2. 性能标记管理器
class PerformanceMarker {constructor() {this.marks = new Map();}mark(name) {performance.mark(name);this.marks.set(name, performance.now());}measure(name, startMark, endMark) {performance.measure(name, startMark, endMark);const measure = performance.getEntriesByName(name, 'measure')[0];return {name,duration: measure.duration,startTime: measure.startTime};}clearMarks() {performance.clearMarks();this.marks.clear();}clearMeasures() {performance.clearMeasures();}
}// 3. 用户交互监控
class InteractionMonitor {constructor() {this.interactions = [];this.setupListeners();}setupListeners() {const observer = new PerformanceObserver(list => {const entries = list.getEntries();this.processInteractions(entries);});observer.observe({ entryTypes: ['first-input', 'layout-shift', 'largest-contentful-paint']});}processInteractions(entries) {entries.forEach(entry => {this.interactions.push({type: entry.entryType,startTime: entry.startTime,duration: entry.duration,value: entry.value,element: entry.target});});}getInteractionMetrics() {return {fid: this.calculateFID(),cls: this.calculateCLS(),lcp: this.calculateLCP()};}calculateFID() {const fidEntry = this.interactions.find(i => i.type === 'first-input');return fidEntry ? fidEntry.duration : null;}calculateCLS() {return this.interactions.filter(i => i.type === 'layout-shift').reduce((sum, entry) => sum + entry.value, 0);}calculateLCP() {const lcpEntries = this.interactions.filter(i => i.type === 'largest-contentful-paint');return lcpEntries.length > 0 ? lcpEntries[lcpEntries.length - 1].startTime : null;}
}

性能分析工具 🔍

// 1. 性能分析器
class PerformanceAnalyzer {constructor() {this.thresholds = new Map();this.issues = [];}setThreshold(metric, value) {this.thresholds.set(metric, value);}analyzeMetrics(metrics) {this.issues = [];// 分析页面加载性能if (metrics.page) {this.analyzePageMetrics(metrics.page);}// 分析资源加载性能if (metrics.resources) {this.analyzeResourceMetrics(metrics.resources);}// 分析运行时性能if (metrics.runtime) {this.analyzeRuntimeMetrics(metrics.runtime);}return this.issues;}analyzePageMetrics(pageMetrics) {if (pageMetrics.ttfb > this.thresholds.get('ttfb')) {this.issues.push({type: 'warning',metric: 'ttfb',message: 'Time to First Byte is too high',value: pageMetrics.ttfb,threshold: this.thresholds.get('ttfb')});}if (pageMetrics.domReady > this.thresholds.get('domReady')) {this.issues.push({type: 'error',metric: 'domReady',message: 'DOM Ready time is too high',value: pageMetrics.domReady,threshold: this.thresholds.get('domReady')});}}analyzeResourceMetrics(resources) {const largeResources = resources.filter(r => r.size > this.thresholds.get('resourceSize'));if (largeResources.length > 0) {this.issues.push({type: 'warning',metric: 'resourceSize',message: 'Large resources detected',resources: largeResources});}}analyzeRuntimeMetrics(runtime) {if (runtime.memory && runtime.memory.usedJSHeapSize > this.thresholds.get('heapSize')) {this.issues.push({type: 'warning',metric: 'memory',message: 'High memory usage detected',value: runtime.memory.usedJSHeapSize});}if (runtime.fps() < this.thresholds.get('fps')) {this.issues.push({type: 'error',metric: 'fps',message: 'Low FPS detected',value: runtime.fps()});}}generateReport() {return {timestamp: new Date(),issueCount: this.issues.length,criticalIssues: this.issues.filter(i => i.type === 'error'),warnings: this.issues.filter(i => i.type === 'warning'),recommendations: this.generateRecommendations()};}generateRecommendations() {return this.issues.map(issue => {switch (issue.metric) {case 'ttfb':return 'Consider using a CDN or optimizing server response time';case 'domReady':return 'Optimize JavaScript execution and reduce blocking resources';case 'resourceSize':return 'Compress and optimize large resources';case 'memory':return 'Check for memory leaks and optimize memory usage';case 'fps':return 'Optimize animations and reduce DOM operations';default:return 'Review and optimize the affected area';}});}
}// 2. 性能监控仪表板
class PerformanceDashboard {constructor() {this.metrics = [];this.charts = new Map();}addMetric(metric) {this.metrics.push({...metric,timestamp: new Date()});this.updateCharts();}createChart(type, data) {// 实现图表创建逻辑return {type,data,render: () => {// 渲染图表}};}updateCharts() {// 更新页面加载时间趋势this.charts.set('loadTime', this.createChart('line',this.metrics.map(m => ({x: m.timestamp,y: m.page.loadComplete}))));// 更新资源使用趋势this.charts.set('resources', this.createChart('bar',this.metrics.map(m => ({x: m.timestamp,y: m.resources.length}))));// 更新内存使用趋势this.charts.set('memory', this.createChart('area',this.metrics.map(m => ({x: m.timestamp,y: m.runtime.memory?.usedJSHeapSize}))));}generateReport(timeRange) {const filteredMetrics = this.metrics.filter(m => m.timestamp >= timeRange.start && m.timestamp <= timeRange.end);return {summary: this.calculateSummary(filteredMetrics),trends: this.calculateTrends(filteredMetrics),issues: this.findIssues(filteredMetrics)};}
}// 3. 性能优化建议生成器
class OptimizationAdvisor {constructor() {this.rules = new Map();}addRule(name, condition, recommendation) {this.rules.set(name, { condition, recommendation });}analyze(metrics) {const recommendations = [];for (const [name, rule] of this.rules) {if (rule.condition(metrics)) {recommendations.push({name,recommendation: rule.recommendation,priority: this.calculatePriority(metrics, name)});}}return recommendations.sort((a, b) => b.priority - a.priority);}calculatePriority(metrics, ruleName) {// 根据性能指标的严重程度计算优化建议的优先级const weights = {loadTime: 0.3,memory: 0.2,fps: 0.3,resources: 0.2};let score = 0;if (metrics.page?.loadComplete > 3000) {score += weights.loadTime;}if (metrics.runtime?.memory?.usedJSHeapSize > metrics.runtime?.memory?.jsHeapSizeLimit * 0.8) {score += weights.memory;}if (metrics.runtime?.fps() < 30) {score += weights.fps;}if (metrics.resources?.length > 50) {score += weights.resources;}return score;}
}

报警和通知系统 🚨

// 1. 报警管理器
class AlertManager {constructor() {this.alerts = new Map();this.handlers = new Map();}addAlert(name, condition, options = {}) {this.alerts.set(name, {condition,threshold: options.threshold,cooldown: options.cooldown || 5 * 60 * 1000, // 5分钟lastTriggered: 0,status: 'inactive'});}addHandler(severity, handler) {if (!this.handlers.has(severity)) {this.handlers.set(severity, []);}this.handlers.get(severity).push(handler);}checkAlerts(metrics) {const now = Date.now();const triggeredAlerts = [];for (const [name, alert] of this.alerts) {if (alert.status === 'inactive' && now - alert.lastTriggered > alert.cooldown) {if (alert.condition(metrics)) {alert.status = 'active';alert.lastTriggered = now;triggeredAlerts.push(name);}}}return triggeredAlerts;}async notify(alertName, data) {const alert = this.alerts.get(alertName);if (!alert) return;const handlers = this.handlers.get(alert.severity) || [];await Promise.all(handlers.map(handler => handler(alertName, data)));}
}// 2. 通知发送器
class NotificationSender {constructor() {this.channels = new Map();}addChannel(name, sender) {this.channels.set(name, sender);}async send(channel, message) {const sender = this.channels.get(channel);if (!sender) {throw new Error(`Channel ${channel} not found`);}try {await sender(message);} catch (error) {console.error(`Failed to send notification to ${channel}:`, error);throw error;}}async broadcast(message) {const results = await Promise.allSettled(Array.from(this.channels.entries()).map(([channel, sender]) => this.send(channel, message)));return results.reduce((summary, result, index) => {const channel = Array.from(this.channels.keys())[index];summary[channel] = result.status === 'fulfilled';return summary;}, {});}
}// 3. 报告生成器
class ReportGenerator {constructor() {this.templates = new Map();}addTemplate(name, template) {this.templates.set(name, template);}generateReport(data, templateName = 'default') {const template = this.templates.get(templateName);if (!template) {throw new Error(`Template ${templateName} not found`);}return template(data);}async saveReport(report, format = 'json') {const fileName = `performance-report-${new Date().toISOString()}.${format}`;switch (format) {case 'json':await fs.writeFile(fileName, JSON.stringify(report, null, 2));break;case 'html':await fs.writeFile(fileName, this.generateHtmlReport(report));break;case 'pdf':await this.generatePdfReport(report, fileName);break;default:throw new Error(`Unsupported format: ${format}`);}return fileName;}generateHtmlReport(report) {// 生成HTML格式的报告return `<!DOCTYPE html><html><head><title>Performance Report</title></head><body><h1>Performance Report</h1><div class="metrics">${this.renderMetrics(report.metrics)}</div><div class="issues">${this.renderIssues(report.issues)}</div><div class="recommendations">${this.renderRecommendations(report.recommendations)}</div></body></html>`;}
}

最佳实践建议 💡

  1. 性能监控策略
// 1. 性能预算管理器
class PerformanceBudgetManager {constructor() {this.budgets = new Map();}setBudget(metric, limit) {this.budgets.set(metric, limit);}checkBudget(metric, value) {const limit = this.budgets.get(metric);if (!limit) return true;return value <= limit;}generateBudgetReport(metrics) {const report = {timestamp: new Date(),violations: [],status: 'pass'};for (const [metric, limit] of this.budgets) {const value = metrics[metric];if (value > limit) {report.violations.push({metric,limit,value,overage: value - limit});report.status = 'fail';}}return report;}
}// 2. 性能监控配置管理器
class MonitoringConfigManager {constructor() {this.config = {sampleRate: 0.1,metrics: new Set(),alertThresholds: new Map()};}setSampleRate(rate) {if (rate < 0 || rate > 1) {throw new Error('Sample rate must be between 0 and 1');}this.config.sampleRate = rate;}enableMetric(metric) {this.config.metrics.add(metric);}disableMetric(metric) {this.config.metrics.delete(metric);}setAlertThreshold(metric, threshold) {this.config.alertThresholds.set(metric, threshold);}shouldCollect() {return Math.random() < this.config.sampleRate;}
}// 3. 性能数据存储管理器
class MetricsStorageManager {constructor() {this.storage = new Map();this.retention = 30 * 24 * 60 * 60 * 1000; // 30天}store(metrics) {const timestamp = Date.now();this.storage.set(timestamp, metrics);this.cleanup();}cleanup() {const cutoff = Date.now() - this.retention;for (const [timestamp] of this.storage) {if (timestamp < cutoff) {this.storage.delete(timestamp);}}}query(timeRange) {const results = [];for (const [timestamp, metrics] of this.storage) {if (timestamp >= timeRange.start && timestamp <= timeRange.end) {results.push({ timestamp, metrics });}}return results;}
}

结语 📝

JavaScript性能监控系统是保证应用性能和用户体验的关键工具。通过本文,我们学习了:

  1. 性能指标的收集和分析
  2. 性能监控工具的实现
  3. 报警和通知系统的构建
  4. 性能报告的生成
  5. 最佳实践和优化建议

💡 学习建议:在实施性能监控时,要注意平衡监控的全面性和系统性能的开销。选择合适的采样率和监控指标,避免监控系统本身成为性能瓶颈。同时,要建立完善的报警机制和响应流程,确保能够及时发现和解决性能问题。


如果你觉得这篇文章有帮助,欢迎点赞收藏,也期待在评论区看到你的想法和建议!👇

终身学习,共同成长。

咱们下一期见

💻

相关文章:

JavaScript系列(58)--性能监控系统详解

JavaScript性能监控系统详解 &#x1f4ca; 今天&#xff0c;让我们深入探讨JavaScript的性能监控系统。性能监控对于保证应用的稳定性和用户体验至关重要。 性能监控基础概念 &#x1f31f; &#x1f4a1; 小知识&#xff1a;JavaScript性能监控是指通过收集和分析各种性能指…...

GESP2023年12月认证C++六级( 第三部分编程题(1)闯关游戏)

参考程序代码&#xff1a; #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <string> #include <map> #include <iostream> #include <cmath> using namespace std;const int N 10…...

git 新项目

新项目git 新建的项目如何进行git 配置git git config --global user.name "cc" git config --global user.email ccexample.com配置远程仓库路径 // 添加 git remote add origin http://gogs/cc/mc.git //如果配错了&#xff0c;删除 git remote remove origin初…...

系统URL整合系列视频一(需求方案)

视频 系统URL整合系列视频一&#xff08;需求方案&#xff09; 视频介绍 &#xff08;全国&#xff09;某大型分布式系统Web资源URL整合需求实现方案讲解。当今社会各行各业对软件系统的web资源访问权限控制越来越严格&#xff0c;控制粒度也越来越细。安全级别提高的同时也增…...

Vue.js 使用组件库构建 UI

Vue.js 使用组件库构建 UI 在 Vue.js 项目中&#xff0c;构建漂亮又高效的用户界面&#xff08;UI&#xff09;是很重要的一环。组件库就是你开发 UI 的好帮手&#xff0c;它可以大大提高开发效率&#xff0c;减少重复工作&#xff0c;还能让你的项目更具一致性和专业感。今天…...

计算图 Compute Graph 和自动求导 Autograd | PyTorch 深度学习实战

前一篇文章&#xff0c;Tensor 基本操作5 device 管理&#xff0c;使用 GPU 设备 | PyTorch 深度学习实战 本系列文章 GitHub Repo: https://github.com/hailiang-wang/pytorch-get-started PyTorch 计算图和 Autograd 微积分之于机器学习Computational Graphs 计算图Autograd…...

51单片机入门_05_LED闪烁(常用的延时方法:软件延时、定时器延时;while循环;unsigned char 可以表示的数字是0~255)

本篇介绍编程实现LED灯闪烁&#xff0c;需要学到一些新的C语言知识。由于单片机执行的速度是非常快的&#xff0c;如果不进行延时的话&#xff0c;人眼是无法识别(停留时间要大于20ms)出LED灯是否在闪烁所以需要学习如何实现软件延时。另外IO口与一个字节位的数据对应关系。 文…...

如何获取sql数据中时间的月份、年份(类型为date)

可用自带的函数month来实现 如&#xff1a; 创建表及插入数据&#xff1a; create table test (id int,begindate datetime) insert into test values (1,2015-01-01) insert into test values (2,2015-02-01) 执行sql语句,获取月份&#xff1a; select MONTH(begindate)…...

【单层神经网络】softmax回归的从零开始实现(图像分类)

softmax回归 该回归分析为后续的多层感知机做铺垫 基本概念 softmax回归用于离散模型预测&#xff08;分类问题&#xff0c;含标签&#xff09; softmax运算本质上是对网络的多个输出进行了归一化&#xff0c;使结果有一个统一的判断标准&#xff0c;不必纠结为什么要这么算…...

使用开源项目:pdf2docx,让PDF转换为Word

目录 1.安装python 2.安装 pdf2docx 3.使用 pdf2docx 转换 PDF 到 Word pdf2docx&#xff1a;GitCode - 全球开发者的开源社区,开源代码托管平台 环境&#xff1a;windows电脑 1.安装python Download Python | Python.org 最好下载3.8以上的版本 安装时记得选择上&#…...

保姆级教程Docker部署KRaft模式的Kafka官方镜像

目录 一、安装Docker及可视化工具 二、单节点部署 1、创建挂载目录 2、运行Kafka容器 3、Compose运行Kafka容器 4、查看Kafka运行状态 三、集群部署 四、部署可视化工具 1、创建挂载目录 2、运行Kafka-ui容器 3、Compose运行Kafka-ui容器 4、查看Kafka-ui运行状态 …...

ChatGPT提问技巧:行业热门应用提示词案例--咨询法律知识

ChatGPT除了可以协助办公&#xff0c;写作文案和生成短视频脚本外&#xff0c;和还可以做为一个法律工具&#xff0c;当用户面临一些法律知识盲点时&#xff0c;可以向ChatGPT咨询获得解答。赋予ChatGPT专家的身份&#xff0c;用户能够得到较为满意的解答。 1.咨询法律知识 举…...

openRv1126 AI算法部署实战之——Tensorflow模型部署实战

在RV1126开发板上部署Tensorflow算法&#xff0c;实时目标检测RTSP传输。视频演示地址 rv1126 yolov5 实时目标检测 rtsp传输_哔哩哔哩_bilibili ​ 一、准备工作 从官网下载tensorflow模型和数据集 手动在线下载&#xff1a; https://github.com/tensorflow/models/b…...

STM32 TIM定时器配置

TIM简介 TIM&#xff08;Timer&#xff09;定时器 定时器可以对输入的时钟进行计数&#xff0c;并在计数值达到设定值时触发中断 16位计数器、预分频器、自动重装寄存器的时基单元&#xff0c;在72MHz计数时钟下可以实现最大59.65s的定时 不仅具备基本的定时中断功能&#xff…...

51单片机 05 矩阵键盘

嘻嘻&#xff0c;LCD在RC板子上可以勉强装上&#xff0c;会有一点歪。 一、矩阵键盘 在键盘中按键数量较多时&#xff0c;为了减少I/O口的占用&#xff0c;通常将按键排列成矩阵形式&#xff1b;采用逐行或逐列的“扫描”&#xff0c;就可以读出任何位置按键的状态。&#xf…...

SSRF 漏洞利用 Redis 实战全解析:原理、攻击与防范

目录 前言 SSRF 漏洞深度剖析 Redis&#xff1a;强大的内存数据库 Redis 产生漏洞的原因 SSRF 漏洞利用 Redis 实战步骤 准备环境 下载安装 Redis 配置漏洞环境 启动 Redis 攻击机远程连接 Redis 利用 Redis 写 Webshell 防范措施 前言 在网络安全领域&#xff0…...

kubernetes学习-配置管理(九)

一、ConfigMap &#xff08;1&#xff09;通过指定目录&#xff0c;创建configmap # 创建一个config目录 [rootk8s-master k8s]# mkdir config[rootk8s-master k8s]# cd config/ [rootk8s-master config]# mkdir test [rootk8s-master config]# cd test [rootk8s-master test…...

python 语音识别

目录 一、语音识别 二、代码实践 2.1 使用vosk三方库 2.2 使用SpeechRecognition 2.3 使用Whisper 一、语音识别 今天识别了别人做的这个app,觉得虽然是个日记app 但是用来学英语也挺好的,能进行语音识别,然后矫正语法,自己说的时候 ,实在不知道怎么说可以先乱说,然…...

一文速览DeepSeek-R1的本地部署——可联网、可实现本地知识库问答:包括671B满血版和各个蒸馏版的部署

前言 自从deepseek R1发布之后「详见《一文速览DeepSeek R1&#xff1a;如何通过纯RL训练大模型的推理能力以比肩甚至超越OpenAI o1(含Kimi K1.5的解读)》」&#xff0c;deepseek便爆火 爆火以后便应了“人红是非多”那句话&#xff0c;不但遭受各种大规模攻击&#xff0c;即便…...

[mmdetection]fast-rcnn模型训练自己的数据集的详细教程

本篇博客是由本人亲自调试成功后的学习笔记。使用了mmdetection项目包进行fast-rcnn模型的训练&#xff0c;数据集是自制图像数据。废话不多说&#xff0c;下面进入训练步骤教程。 注&#xff1a;本人使用linux服务器进行展示&#xff0c;Windows环境大差不差。另外&#xff0…...

深度学习在微纳光子学中的应用

深度学习在微纳光子学中的主要应用方向 深度学习与微纳光子学的结合主要集中在以下几个方向&#xff1a; 逆向设计 通过神经网络快速预测微纳结构的光学响应&#xff0c;替代传统耗时的数值模拟方法。例如设计超表面、光子晶体等结构。 特征提取与优化 从复杂的光学数据中自…...

可靠性+灵活性:电力载波技术在楼宇自控中的核心价值

可靠性灵活性&#xff1a;电力载波技术在楼宇自控中的核心价值 在智能楼宇的自动化控制中&#xff0c;电力载波技术&#xff08;PLC&#xff09;凭借其独特的优势&#xff0c;正成为构建高效、稳定、灵活系统的核心解决方案。它利用现有电力线路传输数据&#xff0c;无需额外布…...

【解密LSTM、GRU如何解决传统RNN梯度消失问题】

解密LSTM与GRU&#xff1a;如何让RNN变得更聪明&#xff1f; 在深度学习的世界里&#xff0c;循环神经网络&#xff08;RNN&#xff09;以其卓越的序列数据处理能力广泛应用于自然语言处理、时间序列预测等领域。然而&#xff0c;传统RNN存在的一个严重问题——梯度消失&#…...

【大模型RAG】Docker 一键部署 Milvus 完整攻略

本文概要 Milvus 2.5 Stand-alone 版可通过 Docker 在几分钟内完成安装&#xff1b;只需暴露 19530&#xff08;gRPC&#xff09;与 9091&#xff08;HTTP/WebUI&#xff09;两个端口&#xff0c;即可让本地电脑通过 PyMilvus 或浏览器访问远程 Linux 服务器上的 Milvus。下面…...

ServerTrust 并非唯一

NSURLAuthenticationMethodServerTrust 只是 authenticationMethod 的冰山一角 要理解 NSURLAuthenticationMethodServerTrust, 首先要明白它只是 authenticationMethod 的选项之一, 并非唯一 1 先厘清概念 点说明authenticationMethodURLAuthenticationChallenge.protectionS…...

自然语言处理——Transformer

自然语言处理——Transformer 自注意力机制多头注意力机制Transformer 虽然循环神经网络可以对具有序列特性的数据非常有效&#xff0c;它能挖掘数据中的时序信息以及语义信息&#xff0c;但是它有一个很大的缺陷——很难并行化。 我们可以考虑用CNN来替代RNN&#xff0c;但是…...

(转)什么是DockerCompose?它有什么作用?

一、什么是DockerCompose? DockerCompose可以基于Compose文件帮我们快速的部署分布式应用&#xff0c;而无需手动一个个创建和运行容器。 Compose文件是一个文本文件&#xff0c;通过指令定义集群中的每个容器如何运行。 DockerCompose就是把DockerFile转换成指令去运行。 …...

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…...

九天毕昇深度学习平台 | 如何安装库?

pip install 库名 -i https://pypi.tuna.tsinghua.edu.cn/simple --user 举个例子&#xff1a; 报错 ModuleNotFoundError: No module named torch 那么我需要安装 torch pip install torch -i https://pypi.tuna.tsinghua.edu.cn/simple --user pip install 库名&#x…...

React---day11

14.4 react-redux第三方库 提供connect、thunk之类的函数 以获取一个banner数据为例子 store&#xff1a; 我们在使用异步的时候理应是要使用中间件的&#xff0c;但是configureStore 已经自动集成了 redux-thunk&#xff0c;注意action里面要返回函数 import { configureS…...