使用Prometheus监控Padavan路由器

news2025/1/12 13:09:30

Prometheus监控Padavan路由器

1、背景

近期在Synology(群辉)中安装一套Prometheus监控程序,目前已经监控Synology,然后家中有有路由器(Padavan)型号,也准备使用Prometheus+Grafan进行监控。

环境:

Prometheus:2.48.0

Grafan:10

Padavan:固件版本:3.4.3.9-099_22-05-1

image

2、监控步骤

1、padavan_exporter 正确使用

地址:https://github.com/Bpazy/padavan_exporter/blob/master/README-zh_CN.md

padavan_exporter有两种方式(不是放到Padavan系统上的)

  1. 安装到Linux操作系统,通过ssh连接到路由器进行数据获取
  2. 安装到Docker上,通过ssh连接到路由器进行数据获取
Linux操作系统

在Linux操作系统下载padavan_exporter

参数使用

$ ./padavan_exporter --help
Flags:
  --help                        Show context-sensitive help (also try
                                --help-long and --help-man).
  --web.listen-address=":9100"  Address on which to expose metrics and web
                                interface
  --padavan.ssh.host="127.0.0.1:22"
                                Padavan ssh host
  --padavan.ssh.username="admin"
                                Padavan ssh username
  --padavan.ssh.password="admin"
                                Padavan ssh password
  --debug                       Debug mode

安装 padavan_exporter 并使用正确的参数启动(点击跳转项目首页)

wget https://github.com/Bpazy/padavan_exporter/releases/download/v0.0.2/padavan_exporter-linux-amd64-v0.0.2
sudo mv ./padavan_exporter-linux-amd64-v0.0.2 /usr/local/bin/padavan_exporter
sudo chmod u=rwx,o=rx,g=rx /usr/local/bin/padavan_exporter
sudo chgrp root /usr/local/bin/padavan_exporter
sudo chown root /usr/local/bin/padavan_exporter

# 自定义 systemd service
sudo touch /lib/systemd/system/padavan_exporter.service
sudo cat <<EOF >/lib/systemd/system/padavan_exporter.service
[Unit]
Description=Node exporter
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/padavan_exporter  --padavan.ssh.host="127.0.0.1:22"  --padavan.ssh.username="admin"  --padavan.ssh.password="admin"
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

# 加载自定义的 service
sudo systemctl daemon-reload
# 开机自启
sudo systemctl enable padavan_exporter 
# 启动
sudo systemctl start padavan_exporter 

Docker Compose(推荐)

当然更好的方式是使用 Docker Compose,你可以参考本项目预置的 docker-compose.yml 文件。

此处要注意,我把9100端口 映射到 9101,因为 我的 9100端口已经被占用,你们要注意

version: '3'
services:
 padavan_exporter:
  image: bpazy/padavan_exporter:latest
  restart: always
  ports:
      - "9101:9100"
  command: ["--padavan.ssh.host=192.168.123.1:22", "--padavan.ssh.username=admin", "--padavan.ssh.password=admin"]

image

测试数据

image

Prometheus修改配置重载

  - job_name: 'padavan'
    static_configs:
    - targets: ['192.168.123.200:9101']

2、Grafana 导入图形

这个图在Dashboard: https://grafana.com/grafana/dashboards/15978 进行修改 根补充

Padavan

如果导入没数据,请编辑
在这里插入图片描述

然后在Prometheus上进行调试
在这里插入图片描述

下载Json文件导入
Padavan-1701611865144.json

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "10.2.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph (old)"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Padavan exporter's Dashboard 南宫乘风 fix ",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 15978,
  "graphTooltip": 2,
  "id": null,
  "links": [
    {
      "asDropdown": false,
      "icon": "external link",
      "includeVars": false,
      "keepTime": false,
      "tags": [],
      "targetBlank": false,
      "title": "如果不显示数据,请手动修改 页面中的标签数据(请点击,请查询博客教程)",
      "tooltip": "",
      "type": "link",
      "url": "https://blog.csdn.net/heian_99"
    }
  ],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 9,
      "panels": [],
      "title": "基础信息",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": true,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "负载",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 2,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 11,
        "x": 0,
        "y": 1
      },
      "id": 15,
      "options": {
        "legend": {
          "calcs": [
            "max",
            "min",
            "mean"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "node_load1{job=\"padavan\"}",
          "instant": false,
          "legendFormat": "1分钟负载",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "node_load5{job=\"padavan\"}",
          "hide": false,
          "instant": false,
          "legendFormat": "5分钟负载",
          "range": true,
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "node_load15{job=\"padavan\"}",
          "hide": false,
          "instant": false,
          "legendFormat": "15分钟负载",
          "range": true,
          "refId": "C"
        }
      ],
      "title": "设备负载",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 25,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "fieldMinMax": true,
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 11,
        "y": 1
      },
      "id": 14,
      "options": {
        "legend": {
          "calcs": [
            "max",
            "min",
            "mean"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "100- (\r\n  (\r\n    sum without (mode) (rate(node_cpu_seconds_total{job=\"padavan\", cpu=\"cpu\"}[5m]))\r\n    -\r\n    sum without (mode) (rate(node_cpu_seconds_total{job=\"padavan\",cpu=\"cpu\", mode=\"idle\"}[5m]))\r\n  ) / \r\n  sum without (mode) (rate(node_cpu_seconds_total{job=\"padavan\",cpu=\"cpu\"}[5m]))\r\n) * 100",
          "instant": false,
          "legendFormat": "cpu使用率",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "CPU使用率",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "description": "1H路由器数据",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": true,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 100,
            "gradientMode": "hue",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "percent"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 2,
          "fieldMinMax": false,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 11,
        "x": 0,
        "y": 10
      },
      "id": 8,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "10.2.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "increase(node_network_receive_bytes_total{job=\"padavan\",device=~'br0|eth2.2'}[1h])",
          "format": "time_series",
          "interval": "30m",
          "legendFormat": "{{device}} 下载",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "increase(node_network_transmit_bytes_total{job=\"padavan\",device=~'eth2|br0|eth2.2'}[1h])",
          "interval": "30m",
          "legendFormat": "{{device}}  上传",
          "range": true,
          "refId": "B"
        }
      ],
      "title": "1H路由器数据",
      "type": "timeseries"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 11,
        "y": 10
      },
      "hiddenSeries": false,
      "id": 4,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.2.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "$$hashKey": "object:250",
          "alias": "ppp0 receive rate",
          "color": "#5794F2",
          "fill": 0,
          "yaxis": 2
        },
        {
          "$$hashKey": "object:251",
          "alias": "ppp0 receive total",
          "color": "#B877D9"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "increase(node_network_receive_bytes_total{job=\"padavan\", device=~\"eth2.2|br0\"}[1000w])",
          "interval": "",
          "legendFormat": "{{device}} 接收总数",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "rate(node_network_receive_bytes_total{device=~\"eth2.2|br0\", job=\"padavan\"}[1m])",
          "interval": "",
          "legendFormat": "{{device}}  接收速率",
          "range": true,
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "网络下载总计",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:268",
          "format": "decbytes",
          "label": "Receive Total",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:269",
          "format": "Bps",
          "label": "Receive Rate",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 11,
        "x": 0,
        "y": 19
      },
      "hiddenSeries": false,
      "id": 6,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.2.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "$$hashKey": "object:824",
          "alias": "ppp0 download bandwidth",
          "color": "#5794F2"
        },
        {
          "$$hashKey": "object:825",
          "alias": "ppp0 upload bandwidth",
          "color": "#73BF69"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "rate(node_network_transmit_bytes_total{device=~\"eth2.2|br0\",  job=\"padavan\"}[1m])*8",
          "instant": false,
          "interval": "",
          "legendFormat": "{{device}} 上传",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "rate(node_network_receive_bytes_total{device=~\"eth2.2|br0\",  job=\"padavan\"}[1m])*8",
          "instant": false,
          "interval": "",
          "legendFormat": "{{device}} 下载",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "网络带宽",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:838",
          "format": "decbits",
          "label": "",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:839",
          "format": "short",
          "label": "",
          "logBase": 1,
          "show": false
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 11,
        "y": 19
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "10.2.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "$$hashKey": "object:723",
          "alias": "ppp0 transmit rate",
          "color": "#73BF69",
          "fill": 0,
          "yaxis": 2
        },
        {
          "$$hashKey": "object:724",
          "alias": "ppp0 transmit total",
          "color": "#B877D9"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "increase(node_network_transmit_bytes_total{job=\"padavan\",  device=~\"eth2.2|br0\"}[1000w])",
          "interval": "",
          "legendFormat": "{{device}} 上传总计",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "editorMode": "code",
          "expr": "rate(node_network_transmit_bytes_total{device=~\"eth2.2|br0\", job=\"padavan\"}[1m])",
          "interval": "",
          "legendFormat": "{{device}} 上传速率",
          "range": true,
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "网络上传总计",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:741",
          "format": "decbytes",
          "label": "Transmit Total",
          "logBase": 1,
          "show": true
        },
        {
          "$$hashKey": "object:742",
          "format": "Bps",
          "label": "Transmit Rate",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": 0
      }
    }
  ],
  "refresh": "10s",
  "schemaVersion": 38,
  "tags": [
    "jokersy"
  ],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Padavan",
  "uid": "5BoX3my7z",
  "version": 30,
  "weekStart": ""
}

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

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

相关文章

计算机网络扫盲(4)——时延

一、概述 在这里&#xff0c;我们考虑分组交换网的情况&#xff0c;因特网可以被看成是一种基础设施&#xff0c;该基础设施为运行在端系统上的分布式应用提供服务。在理想情况下&#xff0c;我们希望因特网服务能够在任意两个端系统之间随心所欲地移动数据而没有任何数据地丢失…

智能优化算法应用:基于海洋捕食者算法无线传感器网络(WSN)覆盖优化 - 附代码

智能优化算法应用&#xff1a;基于海洋捕食者算法无线传感器网络(WSN)覆盖优化 - 附代码 文章目录 智能优化算法应用&#xff1a;基于海洋捕食者算法无线传感器网络(WSN)覆盖优化 - 附代码1.无线传感网络节点模型2.覆盖数学模型及分析3.海洋捕食者算法4.实验参数设定5.算法结果…

已解决:虚拟机集群xsehll连接不上

问题描述&#xff1a; hadoop102能连上&#xff0c;hadoop103、hadoop104无法连接&#xff0c;以前都能连上&#xff0c;今天突然就连不上了 解决方案&#xff1a; 使用ifconfig命令查看有没有ens33 如果没有的话那就证明你的问题和我一样 依次使用以下命令&#xff1a; sys…

Docker 简介,Docker 安装——3

目录&#xff1a; Docker 简介 什么是虚拟化、容器化&#xff1f;为什么要虚拟化、容器化&#xff1f;虚拟化实现方式 应用程序执行环境分层虚拟化常见类别 虚拟机容器JVM 之类的虚拟机常见虚拟化实现 主机虚拟化(虚拟机)实现容器虚拟化实现 容器虚拟化实现原理容器虚拟化基础…

SSM新闻发布管理系统

SSM毕设分享 序号1&#xff1a;SSM新闻发布管理系统 1 项目简介 Hi&#xff0c;各位同学好&#xff0c;这里是郑师兄&#xff01; 今天向大家分享一个毕业设计项目作品【SSM新闻发布管理系统】 师兄根据实现的难度和等级对项目进行评分(最低0分&#xff0c;满分5分) 难度系数…

人工智能发展史

人工智能&#xff08;AI&#xff09;的发展史是一段跨越数十年的旅程&#xff0c;涵盖了从早期理论探索到现代技术革新的广泛内容。人工智能的发展历程展示了从最初的概念探索到现代技术突破的演变。尽管经历了多次起伏&#xff0c;但AI领域持续进步&#xff0c;不断拓展其应用…

unordered_map与unordered_set的实现(含迭代器)

unordered_map与unordered_set的实现 文章目录 unordered_map与unordered_set的实现前言一、问题一HashTable.h 二、问题二&问题三1.封装时如何取出key2.不同类型key如何建立对应关系 三、问题四&问题五问题四问题五 四、实现代码MyUnorderedSet.hMyUnorderedMap.hHash…

C 语言实现TCP 通信,以及地址复用

服务端 #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <arpa/inet.h>int main() {//监听套接字文件描述符int listenFd -1;//连接套接字的文件描述符int connFd -1;//服务器的地址结构st…

python scipy.spatial.distance.pdist学习详记——(待完善)

1.Python scipy.spatial.distance.pdist用法及代码示例

《许犁庭与柔性世界》第二十九章 掷红鸟

“没事&#xff0c;其实我也想到了你会走&#xff0c;谁能在那又臭又脏的烟囱里待那么久。所以我就急匆匆地出去找你&#xff0c;找遍了附近都找不着&#xff0c;却突然在大屏幕上看到你正受着陆捋须的折磨。” “唔~~~” “这死家伙可真过分&#xff01;难怪学院里那么多人讨厌…

继续画图带你学习TCP 其他 7 大特性

四、滑动窗口机制 五、流量控制 六、拥塞控制 (安全机制) 七、延迟应答 (效率机制) 八、捎带应答 (效率机制) 九、粘包问题 十、保活机制 TCP总结 四、滑动窗口机制 滑动窗口机制&#xff0c;是在可靠性的前提下&#xff0c;进一步地提高传输效率 认识滑动窗口 一发一收…

24.Python 网络编程之socket编程

目录 1.认识TCP/IP2.socket编程2.1 使用socket2.2 使用socketserver 1.认识TCP/IP 计算机网络就是把各个计算机连接在一起&#xff0c;在网络中的计算机可以互相通信。 网络编程是如何在程序中实现两台计算机的通信。 网络通信是两台计算机上的两个进程之间的通信。 为了把…

第十一节HarmonyOS 常用容器组件3-Tabs

一、Tabs 1、概述 我们经常使用时&#xff0c;会出现试图切换的场景&#xff0c;比如底部有多个菜单&#xff0c;“首页”、 “我的”等。 两个内容容器的切换&#xff1a; ArkUI开发框架提供了一种页签容器组件Tabs&#xff0c;开发者通过Tabs组件可以很容易的实现内容视图…

目标检测算法改进系列之添加变核卷积AKConv模块

AKConv变核卷积 KConv的主要思想&#xff1a;AKConv&#xff08;可变核卷积&#xff09;主要提供一种灵活的卷积机制&#xff0c;允许卷积核具有任意数量的参数和采样形状。这种方法突破了传统卷积局限于固定局部窗口和固定采样形状的限制&#xff0c;从而使得卷积操作能够更加…

C# OpenVINO 直接读取百度Paddle模型实现物体检测( yolov3_darknet)

目录 效果 项目 代码 下载 C# OpenVINO 直接读取百度Paddle模型实现物体检测( yolov3_darknet) 效果 项目 代码 using OpenCvSharp; using Sdcb.OpenVINO; using Sdcb.OpenVINO.Natives; using System; using System.Collections.Generic; using System.Diagnostics; usi…

Micropython for QNX编译过程

Micropython for QNX编译过程 执行步骤 1. https://github.com/micropython/micropython select tag 1.20.0 git clone micropython 2. make -C mpy-cross 3. 修改py/mkenv.mk CROSS_COMPILE ntoaarch64- 注意如果这步必须在make -C mpy-cross 之后执行&#xff0c;如果需要重…

什么?居然可以免费使用Jetbrains?!

JetBrains是一家捷克的软件开发公司&#xff0c;该公司位于捷克的布拉格&#xff0c;并在俄罗斯的圣彼得堡及美国麻州波士顿都设有办公室&#xff0c;该公司最为人所熟知的产品是Java编程语言开发撰写时所用的集成开发环境&#xff1a;IntelliJ IDEA。 如下是jetbrains旗下的产…

Ps:使用 Emoji 字符

Emoji 字符是一种在数字通讯中广泛使用的小图像或表情符号&#xff0c;用于表达情感、活动、物体、地点、天气情况等。 Emoji 源自日本&#xff0c;但现已成为全球数字沟通的一部分。这些字符通常是彩色的&#xff0c;并且能够在不同的设备和平台上保持一致性。 通常&#xff0…

以用户为中心的前端性能

1. 简介 前端性能跟用户体验息息相关。举个栗子&#xff0c;当你打开乘车码扫码进站&#xff0c;网页白屏了很久才加载出来&#xff0c;延误了乘车时间&#xff1b;当你在微信抢红包时&#xff0c;点击按钮后延迟了一会才开始转圈圈&#xff0c;最终没抢到红包。当出现这样的情…

python自学之《艾伯特用Python做科学计算》(1)——(待完善)

好吧&#xff0c;刚开始就打了一波而广告 啄木鸟社区的Python图书概览&#xff1a; http://wiki.woodpecker.org.cn/moin/PyBooks &#xff08;22/388&#xff09;