上一页 1 2 3 4 5 6 ··· 18 下一页
摘要: golang可以执行命令,得到输出的结果,但如果想监控执行过程,怎么做呢? 阅读全文
posted @ 2023-02-19 16:51 NetRookieX 阅读(604) 评论(0) 推荐(0) 编辑
摘要: 以SRE的视角浅谈了一下如何提高监控告警的有效性,防止维护人员麻木、影响服务稳定性。 阅读全文
posted @ 2023-02-19 16:18 NetRookieX 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 下面代码完成了以下功能: 扫描可用ip监控指定网卡的状态 #!/usr/bin/python3 import paramiko import time class SSHConnection(object): # 初始化主机名称、ip、端口等信息 def __init__(self, hostnam 阅读全文
posted @ 2023-02-04 18:55 NetRookieX 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 简介 官方仓库:https://github.com/GuoFlight/ghttp 重试的逻辑依赖了github.com/avast/retry-go 入门 client := ghttp.Client{ Method: ghttp.MethodGet, Url: "https://www.bai 阅读全文
posted @ 2022-05-15 00:37 NetRookieX 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 背景 本人作为一名SRE,想用Go模拟Cpu占用100% 1秒钟,但是在Go1.13上遇到了问题,1s后Goroutine不会停止。只要用了for{},Goroutine就无法结束,即使主Goroutine结束。在Go1.14及以上版本解决了这个问题。 代码 package main import 阅读全文
posted @ 2022-04-17 01:16 NetRookieX 阅读(11) 评论(0) 推荐(0) 编辑
摘要: Gerr库简介 Golang第三方库 官方仓库:https://github.com/GuoFlight/gerror 特点: 兼容golang原生error库gerror会自动生成traceID,方便排查整条链路的错误。gerror会自动获取错误发生的文件名+函数名+行号,方便问题的定位。 安装 阅读全文
posted @ 2022-04-01 22:42 NetRookieX 阅读(45) 评论(0) 推荐(0) 编辑
摘要: Hello World 阅读全文
posted @ 2022-03-06 13:05 NetRookieX 阅读(24) 评论(0) 推荐(0) 编辑
摘要: Service Mesh简介 Service Mesh直译过来就是服务网格,而他的架构就是一个个微服务组成的网络。 Sidecar简介 Service Mesh中的节点就是Sidecar节点。 sidecar直译过来就是这种摩托车,意为业务容器和非业务容器分离,如agent服务全部部署在非业务容器中 阅读全文
posted @ 2022-01-23 17:13 NetRookieX 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 背景 golang中使用并发要考虑很多问题,如控制并发量、等待Goroutine执行完毕等。 看下面一段代码: var wg sync.WaitGroup count := 10 wg.Add(count) limitGoroutineCount := make(chan int,5) for i: 阅读全文
posted @ 2022-01-03 16:06 NetRookieX 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 简介 本质上布隆过滤器是一种数据结构,比较巧妙的概率型数据结构(probabilistic data structure),特点是高效地插入和查询,可以用来告诉你 “某样东西一定不存在或者可能存在”。 相比于传统的 List、Set、Map 等数据结构,它更高效、占用空间更少,但是缺点是其返回的结果 阅读全文
posted @ 2022-01-02 01:09 NetRookieX 阅读(5) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 18 下一页