上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 53 下一页

2024年3月29日

prometheus类型

摘要: Counter:只增。Gauge:可增可减。Histograms:样本落在桶中,原子统计数量,后面一个bucket包含前面所有bucket计数。一方面,可以在Granafa中使用Heatmap热点图展示;另一方面,可以通过查找桶位置+单个桶内执行插值算法计算百分比对应的近似值,没有Summaries 阅读全文

posted @ 2024-03-29 19:58 王景迁 阅读(32) 评论(0) 推荐(0)

prometheus自定义注册表

摘要: // 在自定义注册表中只有需要的变量,没有默认的Go运行时指标和prometheus指标 registry := prometheus.NewRegistry() test:= prometheus.NewCounter(prometheus.CounterOpts{ Name: "test", H 阅读全文

posted @ 2024-03-29 19:44 王景迁 阅读(29) 评论(0) 推荐(0)

2024年3月28日

go实现LRU

摘要: package main import "fmt" type LRUCache struct { length int cap int cache map[interface{}]*DoubleLinkNode head *DoubleLinkNode tail *DoubleLinkNode } 阅读全文

posted @ 2024-03-28 21:06 王景迁 阅读(18) 评论(0) 推荐(0)

prometheus增加和删除labels

摘要: 在Prometheus中,一个metric可以有多个label,label由key和value组成。 import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prom 阅读全文

posted @ 2024-03-28 20:04 王景迁 阅读(387) 评论(0) 推荐(0)

2024年3月26日

k8s secret

摘要: k8s secret默认类型是Opaque,所有类型secret value都是base64转码值。 创建secret 把用户名和密码base64转码存入echo -n "abc" | base64 apiVersion: v1 kind: Secret metadata: name: test t 阅读全文

posted @ 2024-03-26 09:17 王景迁 阅读(48) 评论(0) 推荐(0)

2024年3月25日

iperf3测试网卡tcp带宽

摘要: iperf3 # 安装iperf3 apt install -y iperf3 # 服务端 iperf3 -s -p 5001 # 客户端 iperf3 -c 192.168.0.112 -p 5001 说明最大带宽是4.25Gb/s。 阅读全文

posted @ 2024-03-25 09:02 王景迁 阅读(157) 评论(0) 推荐(0)

2024年3月22日

go 操作ip

摘要: 获取网卡IPv4地址 package main import ( "fmt" "net" ) func main() { ifname := "ens33" netIf, err := net.InterfaceByName(ifname) if err != nil { fmt.Printf("g 阅读全文

posted @ 2024-03-22 08:57 王景迁 阅读(29) 评论(0) 推荐(0)

2024年3月13日

制作Ubuntu qcow2镜像

摘要: 下载云主机镜像 https://cloud-images.ubuntu.com/releases/ wget https://cloud-images.ubuntu.com/releases/23.10/release-20240307/ubuntu-23.10-server-cloudimg-am 阅读全文

posted @ 2024-03-13 09:11 王景迁 阅读(608) 评论(0) 推荐(0)

client-go使用技巧

摘要: Pod使用spec.serviceAccountName对应的token import "k8s.io/client-go/rest" cfg, err := rest.InClusterConfig() if err != nil { klog.Fatalf("Error building kub 阅读全文

posted @ 2024-03-13 08:51 王景迁 阅读(54) 评论(0) 推荐(0)

2024年3月10日

busybox容器配置北京时间

摘要: docker pull busybox:1.32 docker run --rm -v /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime -itd busybox:1.32 sh k8s挂载 volumeMounts: - name: timezone 阅读全文

posted @ 2024-03-10 21:37 王景迁 阅读(36) 评论(0) 推荐(0)

上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 53 下一页

导航