{"id":21008012,"url":"https://github.com/lflxp/orzdba","last_synced_at":"2025-05-15T02:31:45.865Z","repository":{"id":49880108,"uuid":"105022733","full_name":"lflxp/orzdba","owner":"lflxp","description":"rebuild alibaba orzdba by golang","archived":false,"fork":false,"pushed_at":"2021-06-09T06:17:21.000Z","size":1387,"stargazers_count":8,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-04-03T11:23:54.354Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lflxp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-27T13:38:16.000Z","updated_at":"2021-12-03T02:42:02.000Z","dependencies_parsed_at":"2022-08-29T17:51:17.391Z","dependency_job_id":null,"html_url":"https://github.com/lflxp/orzdba","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Forzdba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Forzdba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Forzdba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Forzdba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lflxp","download_url":"https://codeload.github.com/lflxp/orzdba/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225324165,"owners_count":17456460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T09:11:11.461Z","updated_at":"2024-11-19T09:11:12.165Z","avatar_url":"https://github.com/lflxp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# orzdba\nrebuild alibaba orzdba by golang\n\n# 实现原理 \n\n## Shell+Golang\n\n\u003e //基础:load+cpu+swap\n//cat /proc/loadavg /proc/stat /proc/vmstat /proc/net/dev /proc/diskstats |grep -E '/|cpu|pswpin|pswpout'|sed 's/\\// china /g'|grep -E -w 'china|cpu|pswpin|pswpout'|xargs echo|awk '{print $1,$2,$3,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$20/240,$22/240}'|sed 's/[[:space:]]/,/g'\n//0.22,0.27,0.31,1673683,41,2065716,343819349,6613289,63,105102,0,0,0,0,0\n//基础+网络\n//cat /proc/loadavg /proc/stat /proc/vmstat /proc/net/dev /proc/diskstats |grep -E '/|cpu|pswpin|pswpout|eth0'|sed 's/\\// china /g'|grep -E -w 'china|cpu|pswpin|pswpout|eth0'|xargs echo|awk '{print $1,$2,$3,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$20/240,$22/240,$24,$32}'|sed 's/[[:space:]]/,/g'\n//基础+磁盘\n//cat /proc/loadavg /proc/stat /proc/vmstat /proc/net/dev /proc/diskstats |grep -E '/|cpu|pswpin|pswpout|sda'|sed 's/\\// china /g'|grep -E -w 'china|cpu|pswpin|pswpout|sda'|xargs echo|awk '{print $1,$2,$3,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$20/240,$22/240,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36}'|sed 's/[[:space:]]/,/g\n//全数据：基础+网络+磁盘\n// cat /proc/loadavg /proc/stat /proc/vmstat /proc/net/dev /proc/diskstats |grep -E '/|cpu|pswpin|pswpout|eth0|sda'|sed 's/\\// china /g'|grep -E -w 'china|cpu|pswpin|pswpout|sda|eth0'|xargs echo|awk '{print $1,$2,$3,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$20/240,$22/240,$24,$32,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53}'|sed 's/[[:space:]]/,/g'\n\n## Args\n\n```\nUsage of /var/folders/xs/s2b_zrvs7bz1jkl960nmvq240000gn/T/go-build631741448/b001/exe/main:\n  -B\tPrint Bytes received from/send to MySQL(Bytes_received,Bytes_sent).\n  -C int\n    \t运行时间 默认无限\n  -H string\n    \tMysql连接主机，默认127.0.0.1 (default \"127.0.0.1\")\n  -L string\n    \tPrint to Logfile. (default \"none\")\n  -P string\n    \tMysql连接端口,默认3306 (default \"3306\")\n  -S string\n    \tmysql socket连接文件地址 (default \"/tmp/mysql.sock\")\n  -T\tPrint Threads Status(Threads_running,Threads_connected,Threads_created,Threads_cached).\n  -c\t打印Cpu info\n  -com\n    \tPrint MySQL Status(Com_select,Com_insert,Com_update,Com_delete).\n  -d string\n    \t打印Disk info (default \"none\")\n  -hit\n    \tPrint Innodb Hit%.\n  -i string\n    \t时间间隔 默认1秒 (default \"1\")\n  -innodb\n    \tPrint InnodbInfo(include -t,-innodb_pages,-innodb_data,-innodb_log,-innodb_status)\n  -innodb_data\n    \tPrint Innodb Data Status(Innodb_data_reads/writes/read/written)\n  -innodb_log\n    \tPrint Innodb Log  Status(Innodb_os_log_fsyncs/written)\n  -innodb_pages\n    \tPrint Innodb Buffer Pool Pages Status(Innodb_buffer_pool_pages_data/free/dirty/flushed)\n  -innodb_rows\n    \tPrint Innodb Rows Status(Innodb_rows_inserted/updated/deleted/read).\n  -innodb_status\n    \tPrint Innodb Status from Command: 'Show Engine Innodb Status'\n  -l\t打印Load info\n  -lazy\n    \tPrint Info  (include -t,-l,-c,-s,-com,-hit).\n  -logfile_by_day\n    \tOne day a logfile,the suffix of logfile is 'yyyy-mm-dd';\n  -mysql\n    \tPrint MySQLInfo (include -t,-com,-hit,-T,-B).\n  -n string\n    \t打印net info (default \"none\")\n  -nocolor\n    \t不显示颜色\n  -p string\n    \tmysql密码 (default \"system\")\n  -rt\n    \tPrint MySQL DB RT(us).\n  -s\t打印swap info\n  -semi\n    \t半同步监控\n  -slave\n    \t打印Slave info\n  -sys\n    \tPrint SysInfo   (include -t,-l,-c,-s).\n  -t\t打印当前时间\n  -u string\n    \tmysql用户名 (default \"root\")\n  ```\n  \n\n# 交叉编译\n\n1. Linux 下编译 Mac 和 Windows 64位可执行程序\n\n\u003e CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go  \nCGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go  \n\n2. Windows 下编译 Mac 和 Linux 64位可执行程序\n\n\u003e SET CGO_ENABLED=0  \nSET GOOS=darwin  \nSET GOARCH=amd64  \ngo build main.go  \n  \nSET CGO_ENABLED=0  \nSET GOOS=linux  \nSET GOARCH=amd64  \ngo build main.go  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flflxp%2Forzdba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flflxp%2Forzdba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flflxp%2Forzdba/lists"}