Closed budougumi0617 closed 1 year ago
2021年後半もよろしくおねがいします!! また遅くなってしまいましたが日程調整です 🙏 https://chouseisan.com/s?h=5c804ff51e9648598471b2a02ca5283f
お題候補 ゼロから作る時系列データベースエンジン https://zenn.dev/nakabonne/articles/d300838a1500c7 https://github.com/nakabonne/tstorage
2021/07/08(木) 15:00~16:00にしようと思います、よろしくお願いいたします! (BASEメンバーはカレンダー招待済み)
今日はこちらのzoomでお願いします!!! https://zoom.us/j/91783735964?pwd=cktGSW51clAvdVJQcmtlN2pVQm1xZz09
今日は参加できるかなぁって思ってたんですけど...
このまえみたtestime、Parallel + テーブル駆動テストでもちゃんと動くようになっていた! https://tenntenn.dev/ja/posts/2021-07-06-testtime/
最近proxy serverの知見を3年ぶりに読み返したら面白かったという論理コメントだけおくだけしてね...
https://engineering.mercari.com/blog/entry/2018-12-05-105737/
デバッグどうするんや!!!
みんなgoland。補完便利 daisuzuさんはvim test カバレッジとるためにvimで吐いてエディタで開くをやっている 最近golandでもできるようになったかも知れない
最近VSCodeも手に馴染んできました (InteliJ Key bindのおかげで)
BGM的に聞きに来ました(別の仕事をしながらですが...
VSCodeもデバッグできるよ!! 適当にブレークポイントをはったあと、main関数にフォーカスをあててF5でデバッグを開始すればサーバのデバッグもできる (Docker上のサーバとかだとちょっとめんどくさい
delveは最初go toolsインストール時に入っている dockerのプロセスで実行したいならlaunch.jsonをいじる必要がある curlで普通に実行する分には止まってくれそう
チョットだけ観戦して @cureseven さんの悩みが解決して 888888 って思いました(あと清水さんのあのツイートのあれこれはそういう背景だったんですねっていう知見を得ました(ハイコンテキスト
(次予定の準備で抜けますmm
リモートサーバ上のプロセスに対してデバッグしたいときは↓のやりかたで接続できます https://github.com/go-delve/delve/blob/c223ef656da3ddbab3a58ea87108d4217731a01c/Documentation/faq.md#how-can-i-use-delve-for-remote-debugging
こっちは結構前から差分が出せたけど、いつの間にか go tool pprof
でも差分が見られるようになってた
https://github.com/google/pprof
$ go tool pprof -h
usage:
Produce output in the specified format.
pprof <format> [options] [binary] <source> ...
Omit the format to get an interactive shell whose commands can be used
to generate various views of a profile
pprof [options] [binary] <source> ...
Omit the format and provide the "-http" flag to get an interactive web
interface at the specified host:port that can be used to navigate through
various views of a profile.
pprof -http [host]:[port] [options] [binary] <source> ...
Details:
Output formats (select at most one):
-callgrind Outputs a graph in callgrind format
-comments Output all profile comments
-disasm Output assembly listings annotated with samples
-dot Outputs a graph in DOT format
-eog Visualize graph through eog
-evince Visualize graph through evince
-gif Outputs a graph image in GIF format
-gv Visualize graph through gv
-kcachegrind Visualize report in KCachegrind
-list Output annotated source for functions matching regexp
-pdf Outputs a graph in PDF format
-peek Output callers/callees of functions matching regexp
-png Outputs a graph image in PNG format
-proto Outputs the profile in compressed protobuf format
-ps Outputs a graph in PS format
-raw Outputs a text representation of the raw profile
-svg Outputs a graph in SVG format
-tags Outputs all tags in the profile
-text Outputs top entries in text form
-top Outputs top entries in text form
-topproto Outputs top entries in compressed protobuf format
-traces Outputs all profile samples in text form
-tree Outputs a text rendering of call graph
-web Visualize graph through web browser
-weblist Display annotated source in a web browser
Options:
-call_tree Create a context-sensitive call tree
-compact_labels Show minimal headers
-divide_by Ratio to divide all samples before visualization
-drop_negative Ignore negative differences
-edgefraction Hide edges below <f>*total
-focus Restricts to samples going through a node matching regexp
-hide Skips nodes matching regexp
-ignore Skips paths going through any nodes matching regexp
-intel_syntax Show assembly in Intel syntax
-mean Average sample value over first value (count)
-nodecount Max number of nodes to show
-nodefraction Hide nodes below <f>*total
-noinlines Ignore inlines.
-normalize Scales profile based on the base profile.
-output Output filename for file-based outputs
-prune_from Drops any functions below the matched frame.
-relative_percentages Show percentages relative to focused subgraph
-sample_index Sample value to report (0-based index or name)
-show Only show nodes matching regexp
-show_from Drops functions above the highest matched frame.
-source_path Search path for source files
-tagfocus Restricts to samples with tags in range or matched by regexp
-taghide Skip tags matching this regexp
-tagignore Discard samples with tags in range or matched by regexp
-tagshow Only consider tags matching this regexp
-trim Honor nodefraction/edgefraction/nodecount defaults
-trim_path Path to trim from source paths before search
-unit Measurement units to display
Option groups (only set one per group):
granularity
-functions Aggregate at the function level.
-filefunctions Aggregate at the function level.
-files Aggregate at the file level.
-lines Aggregate at the source code line level.
-addresses Aggregate at the address level.
sort
-cum Sort entries based on cumulative weight
-flat Sort entries based on own weight
Source options:
-seconds Duration for time-based profile collection
-timeout Timeout in seconds for profile collection
-buildid Override build id for main binary
-add_comment Free-form annotation to add to the profile
Displayed on some reports or with pprof -comments
-diff_base source Source of base profile for comparison
-base source Source of base profile for profile subtraction
profile.pb.gz Profile in compressed protobuf format
legacy_profile Profile in legacy pprof format
http://host/profile URL for profile handler to retrieve
-symbolize= Controls source of symbol information
none Do not attempt symbolization
local Examine only local binaries
fastlocal Only get function names from local binaries
remote Do not examine local binaries
force Force re-symbolization
Binary Local path or build id of binary for symbolization
-tls_cert TLS client certificate file for fetching profile and symbols
-tls_key TLS private key file for fetching profile and symbols
-tls_ca TLS CA certs file for fetching profile and symbols
Misc options:
-http Provide web interface at host:port.
Host is optional and 'localhost' by default.
Port is optional and a randomly available port by default.
-no_browser Skip opening a browser for the interactive web UI.
-tools Search path for object tools
Legacy convenience options:
-inuse_space Same as -sample_index=inuse_space
-inuse_objects Same as -sample_index=inuse_objects
-alloc_space Same as -sample_index=alloc_space
-alloc_objects Same as -sample_index=alloc_objects
-total_delay Same as -sample_index=delay
-contentions Same as -sample_index=contentions
-mean_delay Same as -mean -sample_index=delay
Environment Variables:
PPROF_TMPDIR Location for saved profiles (default $HOME/pprof)
PPROF_TOOLS Search path for object-level tools
PPROF_BINARY_PATH Search path for local binary files
default: $HOME/pprof/binaries
searches $name, $path, $buildid/$name, $path/$buildid
* On Windows, %USERPROFILE% is used instead of $HOME
ISUCONのためのpprofというタイムリーなやつ(GoCon 19 Summer in Fukuoka) https://fukuoka.gocon.jp/speakers/seike460/
pprofのことGoCon2019 automnではっぴょうしたひとがいそう? https://twitter.com/karupanerura/status/1188676863675076609
探してみる A.I. @budougumi0617
alp良さそう kataribeよりみやすそう alpも正規表現によるgroupingは必要そう alpは本などでよく解析ツールとして使われているのを見る
ISUCONだと初手pprofつかうよりまずアクセスログ見ることが多いかも https://github.com/matsuu/kataribe https://github.com/tkuchiki/alp
先週のGolang weeklyのトピック e-book 100 Go Mistakes (2022) https://medium.com/solvingalgo/100-go-mistakes-2022-4debd9449a72
rscがめちゃくちゃ良いブログ(たぶん)かいてるよ メモリモデル https://research.swtch.com/mm
go fuzzリリースへの道
[dev.fuzz] all: tracking issue for release-blocking fuzzing work https://github.com/golang/go/issues/47037
go getからgo install へ https://utcc.utoronto.ca/~cks/space/blog/programming/GoAndDeprecatingGoGet
go install golang.org/x/tools/gopls@master golang.org/x/tools@master
が使えるようになる?
ghq getはバイナリファイル生成までできない go get go installはバイナリファイル生成するまで
https://github.com/basebank/gophers-code-reading-party/issues/7#issuecomment-876175674
pprofのことGoCon2019 automnではっぴょうしたひとがいそう?
やっぱりorisanoパイセンだった(具体的な使い方とかはスライドからは読み取れなかった) https://speakerdeck.com/orisano/oss-performance-tuning-tips?slide=54
main
関数で「デバッグの開始」を使って実行開始する-diff_base source Source of base profile for comparison
2021/07/08(木) 15:00~16:00@ Zoom, BASE BANK, Inc.
https://chouseisan.com/s?h=5c804ff51e9648598471b2a02ca5283f
参加者
お題