Skip to content

Commit 5ac87c7

Browse files
authored
Merge pull request #738 from devlights/add-result-in-example
2 parents 04554e5 + 8993af6 commit 5ac87c7

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

examples/basic/profiles/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# サンプルリスト
2+
3+
このディレクトリには以下のサンプルがあります。
4+
5+
| file | example name | note |
6+
| ------------- | ------------ | ----------------------------------------------------- |
7+
| cpuprofile.go | profiles_cpu | pprof を使ってCPUプロファイルを取得するサンプルです。 |

examples/basic/profiles/cpuprofile.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,47 @@ func CpuProfile() error {
6464
output.Stdoutl("", string(buf))
6565

6666
return nil
67+
68+
/*
69+
$ task
70+
task: Task "build" is up to date
71+
task: [run] ./try-golang -onetime
72+
73+
ENTER EXAMPLE NAME: profiles_cpu
74+
75+
[Name] "profiles_cpu"
76+
https://github.com/devlights/try-csharp [170039bytes]
77+
https://github.com/devlights/try-golang [170745bytes]
78+
https://devlights.hatenablog.com/ [121967bytes]
79+
https://github.com/devlights/gomy [168467bytes]
80+
https://github.com/devlights/try-python [182642bytes]
81+
https://github.com/devlights/goxcel [170197bytes]
82+
--------------------------------------------------
83+
File: try-golang
84+
Type: cpu
85+
Time: Jan 30, 2024 at 2:32am (UTC)
86+
Duration: 889.51ms, Total samples = 10ms ( 1.12%)
87+
Showing nodes accounting for 10ms, 100% of 10ms total
88+
flat flat% sum% cum cum%
89+
10ms 100% 100% 10ms 100% runtime/internal/syscall.Syscall6
90+
0 0% 100% 10ms 100% crypto/tls.(*Conn).HandshakeContext (inline)
91+
0 0% 100% 10ms 100% crypto/tls.(*Conn).clientHandshake
92+
0 0% 100% 10ms 100% crypto/tls.(*Conn).flush
93+
0 0% 100% 10ms 100% crypto/tls.(*Conn).handshakeContext
94+
0 0% 100% 10ms 100% crypto/tls.(*clientHandshakeStateTLS13).handshake
95+
0 0% 100% 10ms 100% internal/poll.(*FD).Write
96+
0 0% 100% 10ms 100% internal/poll.ignoringEINTRIO (inline)
97+
0 0% 100% 10ms 100% net.(*conn).Write
98+
0 0% 100% 10ms 100% net.(*netFD).Write
99+
0 0% 100% 10ms 100% net/http.(*persistConn).addTLS.func2
100+
0 0% 100% 10ms 100% syscall.RawSyscall6
101+
0 0% 100% 10ms 100% syscall.Syscall
102+
0 0% 100% 10ms 100% syscall.Write (inline)
103+
0 0% 100% 10ms 100% syscall.write
104+
105+
106+
107+
[Elapsed] 900.186041ms
108+
*/
109+
67110
}

0 commit comments

Comments
 (0)