From 55e670033ba376e35d20d87fab20efbf76c233fb Mon Sep 17 00:00:00 2001 From: xtaci Date: Fri, 11 Aug 2023 12:49:45 +0800 Subject: [PATCH] add default.pgo in client & added an option to enable pprof on client --- client/config.go | 1 + client/default.pgo | Bin 0 -> 12381 bytes client/main.go | 13 +++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 client/default.pgo diff --git a/client/config.go b/client/config.go index 3d807b60c..def0aaf53 100644 --- a/client/config.go +++ b/client/config.go @@ -37,6 +37,7 @@ type Config struct { SnmpPeriod int `json:"snmpperiod"` Quiet bool `json:"quiet"` TCP bool `json:"tcp"` + Pprof bool `json:"pprof"` } func parseJSONConfig(config *Config, path string) error { diff --git a/client/default.pgo b/client/default.pgo new file mode 100644 index 0000000000000000000000000000000000000000..f2168c53ac2bb9931d1f30183c2dcaefcaceff42 GIT binary patch literal 12381 zcmV-jFrv>NiwFP!00004|Fn7soD@~^|Gyr)@L1fPngNyqMVdDCjyfYFW={nqc?JYL zjEBQ)vyAKnXJ!fBod>eyoHGJ0AUS7H!4(ke*7@bb;WmB>}T3TdQttt?8~M1=gS%T6JTP&`}DSJ5f!khRZ?GRzpcr zt8P34I?8JF^By&vg^Q&c&cd2hQ>$(alRC;Q`t0aHUN9R!%2C7Fm_s>QE#s9O9c4Dn z|9C17SI1wfsp0B)9-XJ<8b_+>D67-*Luz&ne8rkw1M?_Pt7V+3>2e?-Z!4!dh-z8c z)pe9L=(mNdtLfQN;tESvi4JmTXslpaCA~jrJrCE!{@H4^n&>2_<}#kj)*Z4Y?f7bK zH9bq_;N=MJ9GQc)skTQM}Py9CE%|Iv49xeT|G?8t5p`qb2=E^Kc%HxXMZ_JJ77;I?3$$EgQ8iay zQuOScTIc2F=?>|j&yMwF;hlJ~lG=$4siAhEalT$xBK>q^I1jq;Iz3C)#vY2qg^j3@ zrWsecb7XC7OpP_&=%S-^QrWv|Uv=<1Qj*odi|8VajGg&9N*C=aRf6Z?ujeDU99R$g z4Ba2fsqR3hD>qL^S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b=+4CcNAgk3_92&#oc%nrO7ZzN5U$OmvGB#;Yp$x`q`I_J+@HykOdxf``ID*gz0mr+fwxp zf0EUt!qsC*tgF9=$rr31tIO6bkO)S?zPtZV%1Lwe`lG5M(lU&b9`zXRW~`?6C1GDp zB_aQlu5{F|#wn+@Gj`WP`*6g1+S#TGq*P%Nx0q5#<-!U>cGHT#OR~>eZC0oU>hG?KsT3CE zOzTVMBL105(5aG;-=^<&tYCO|gi~xP9vWu{bQXOoZJqt=CG~Mpi$rl6ZQ9@dM51Q+ zOvTz8>&#ZWhsUe1^|6o>k^cuF%fN zm)x*9+kHUBJ%SAr?Ii0D1k7l{SKmsr9b2@!GZ;_s=Mx3Vp(?%{2%8CSBA~wDNjE>M zV$savewIrLn+5OjJR9yRS5E&@2|x8gmaS*?(ZiXVw)Lfy*U2ADoH=e}Sb{5XpI$-l zmB!V|DXbYcxoy|oXJiBdE2VH3D5F|r)@o|1hZl&11O9~dg;vI$Y3A#zEtGRdBp7ZJ zi6`1cVpVo&SnENhbk^8aznl6){#d-5zqoDKOsIVLzq*J^wZBslqtGnofDrTL@gGk- z5s7lXi}_sYcd8-PArXnD`}-}5BXQHGooSa2z2mKd#U^)5;)z(Kx9^I|v7o}7q_aP! zzN4(NWGb{-HK;Jrj;8#Xi`lj6>j6u~iq`|yI~%)NK-GGc;keeNZ!3R1qg5L=d)lS5 z=XY(XTBRvV{sG(Db-bq}tojQVW@bd|gQUz7+*kdf9) maxSmuxVer { @@ -443,6 +451,11 @@ func main() { // start snmp logger go generic.SnmpLogger(config.SnmpLog, config.SnmpPeriod) + // start pprof + if config.Pprof { + go http.ListenAndServe(":6060", nil) + } + // start scavenger chScavenger := make(chan timedSession, 128) go scavenger(chScavenger, &config)