perfmonger 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 238da9d952389a0d84f3e619631bb907d604b98a
4
- data.tar.gz: 982086728c90cd798a1ae0316af2cb1e23c87370
2
+ SHA256:
3
+ metadata.gz: 4a60a8aaed2af9077a0027baf15afc68856ed6c5d9a08267dde6a903abeea762
4
+ data.tar.gz: 46113a4949d34a74737acac64f8d032b31cf3bddfdad51dbc158fc0599fa1151
5
5
  SHA512:
6
- metadata.gz: 77b4709a0399f3c3725488b5005ee27028eb5231ae1dc8523c5dc24a92c4adfd8db92e65eba696de7533712e2817923f87edb3582df468fc02b340b1819d5dd9
7
- data.tar.gz: 4fffefe769a436e2456f57c4bef540dbd95f0c4a43d92b392c913c7f472bb8ae7b2d4c8f5f8275f29fe5b89a2576969fe25f5266d8546e45ccfc3289bfd9dbfa
6
+ metadata.gz: 4eacfdf595f3bd39bc64f5516ef8d14eff0a49e9f8befdf7a2102b642dd604be88328783fceb7a1b3163a883554eb624d1b46e88a3a13c23b9265ef0a4b1343c
7
+ data.tar.gz: 1b416767ae0201a1cbb7f500c99f14c88566a86c7a8e03c5f0d56a3b1ba0ba8b12b5491a0a5ac35d2b06263b6af5fbd6b22e7550df8720bd78a183e8c4b68eae
@@ -11,16 +11,13 @@ install:
11
11
  - export GOPATH="$HOME/go"
12
12
  - export PATH="$PATH:$GOPATH/bin"
13
13
  - mkdir -p "$HOME/go/{src,pkg,bin}"
14
- - go get -u github.com/mattn/go-isatty
15
- - go get -u github.com/hayamiz/go-projson
16
- - go get -u golang.org/x/crypto/ssh/terminal
17
- - go get -u github.com/hayamiz/perfmonger/core/subsystem
18
14
  rvm:
19
- - 1.9.3
20
- - 2.0.0
21
- - 2.1.5
22
- - 2.2.0
15
+ - 2.2.10
16
+ - 2.3.8
17
+ - 2.4.5
18
+ - 2.5.3
23
19
  script:
20
+ - rake go_get
24
21
  - rake spec
25
22
  - rake test_core
26
23
  notifications:
data/NEWS CHANGED
@@ -1,3 +1,10 @@
1
+ ## 20XX-XX-XX: PerfMonger 0.12.0
2
+
3
+ ## 2020-03-31: PerfMonger 0.11.2
4
+ * Bug fixes
5
+ * [plot] subcommand:
6
+ * Remove temporary directory correctly
7
+
1
8
  ## 2018-05-15: PerfMonger 0.11.1
2
9
  * Bug fixes
3
10
  * [record] subcommand:
data/README.md CHANGED
@@ -26,7 +26,7 @@ You need gnuplot 4.6.0 or later build with cairo terminals for plotting measurem
26
26
 
27
27
  ### Build from source
28
28
 
29
- You need Ruby 1.9.3 or later, and Go 1.8 or later to build perfmonger.
29
+ You need Ruby 2.2 or later, and Go 1.8 or later to build perfmonger.
30
30
 
31
31
  bundle
32
32
  rake build
data/Rakefile CHANGED
@@ -26,6 +26,8 @@ task :go_get do
26
26
  sh "go get -u github.com/hayamiz/perfmonger/core/subsystem"
27
27
  sh "go get -u golang.org/x/crypto/ssh/terminal"
28
28
  sh "go get -u github.com/mattn/go-isatty"
29
+ sh "go get -u github.com/nsf/termbox-go"
30
+ sh "go get -u github.com/jroimartin/gocui"
29
31
  end
30
32
 
31
33
  desc "Run tests of core recorder/player"
@@ -17,6 +17,10 @@ all: build
17
17
  go build -o $@ perfmonger-player.go $(GO_SRC)
18
18
 
19
19
 
20
+ ../lib/exec/perfmonger-viewer_linux_amd64: perfmonger-viewer.go $(GO_DEPS)
21
+ go build -o $@ perfmonger-viewer.go $(GO_SRC)
22
+
23
+
20
24
  ../lib/exec/perfmonger-summarizer_linux_amd64: perfmonger-summarizer.go $(GO_DEPS)
21
25
  go build -o $@ perfmonger-summarizer.go $(GO_SRC)
22
26
 
@@ -33,6 +37,10 @@ all: build
33
37
  go build -o $@ perfmonger-player.go $(GO_SRC)
34
38
 
35
39
 
40
+ ../lib/exec/perfmonger-viewer_darwin_amd64: perfmonger-viewer.go $(GO_DEPS)
41
+ go build -o $@ perfmonger-viewer.go $(GO_SRC)
42
+
43
+
36
44
  ../lib/exec/perfmonger-summarizer_darwin_amd64: perfmonger-summarizer.go $(GO_DEPS)
37
45
  go build -o $@ perfmonger-summarizer.go $(GO_SRC)
38
46
 
@@ -41,8 +49,8 @@ all: build
41
49
  go build -o $@ perfmonger-plot-formatter.go $(GO_SRC)
42
50
 
43
51
 
44
- build: ../lib/exec/perfmonger-recorder_linux_amd64 ../lib/exec/perfmonger-player_linux_amd64 ../lib/exec/perfmonger-summarizer_linux_amd64 ../lib/exec/perfmonger-plot-formatter_linux_amd64 ../lib/exec/perfmonger-recorder_darwin_amd64 ../lib/exec/perfmonger-player_darwin_amd64 ../lib/exec/perfmonger-summarizer_darwin_amd64 ../lib/exec/perfmonger-plot-formatter_darwin_amd64
52
+ build: ../lib/exec/perfmonger-recorder_linux_amd64 ../lib/exec/perfmonger-player_linux_amd64 ../lib/exec/perfmonger-viewer_linux_amd64 ../lib/exec/perfmonger-summarizer_linux_amd64 ../lib/exec/perfmonger-plot-formatter_linux_amd64 ../lib/exec/perfmonger-recorder_darwin_amd64 ../lib/exec/perfmonger-player_darwin_amd64 ../lib/exec/perfmonger-viewer_darwin_amd64 ../lib/exec/perfmonger-summarizer_darwin_amd64 ../lib/exec/perfmonger-plot-formatter_darwin_amd64
45
53
 
46
54
  clean:
47
- rm -f ../lib/exec/perfmonger-recorder_linux_amd64 ../lib/exec/perfmonger-player_linux_amd64 ../lib/exec/perfmonger-summarizer_linux_amd64 ../lib/exec/perfmonger-plot-formatter_linux_amd64 ../lib/exec/perfmonger-recorder_darwin_amd64 ../lib/exec/perfmonger-player_darwin_amd64 ../lib/exec/perfmonger-summarizer_darwin_amd64 ../lib/exec/perfmonger-plot-formatter_darwin_amd64
55
+ rm -f ../lib/exec/perfmonger-recorder_linux_amd64 ../lib/exec/perfmonger-player_linux_amd64 ../lib/exec/perfmonger-viewer_linux_amd64 ../lib/exec/perfmonger-summarizer_linux_amd64 ../lib/exec/perfmonger-plot-formatter_linux_amd64 ../lib/exec/perfmonger-recorder_darwin_amd64 ../lib/exec/perfmonger-player_darwin_amd64 ../lib/exec/perfmonger-viewer_darwin_amd64 ../lib/exec/perfmonger-summarizer_darwin_amd64 ../lib/exec/perfmonger-plot-formatter_darwin_amd64
48
56
 
@@ -57,7 +57,7 @@ for idx in $(seq 0 $((${#TARGET[@]}-1))); do
57
57
  export var_GOOS=$1
58
58
  export var_GOARCH=$2
59
59
 
60
- for subcmd in recorder player summarizer plot-formatter; do
60
+ for subcmd in recorder player viewer summarizer plot-formatter; do
61
61
  TARGETS+=(../lib/exec/perfmonger-${subcmd}_${var_GOOS}_${var_GOARCH})
62
62
 
63
63
  cat <<EOF >> $makefile
@@ -0,0 +1,164 @@
1
+ //usr/bin/env go run $0 $@ ; exit
2
+
3
+ package main
4
+
5
+ import (
6
+ "fmt"
7
+ "log"
8
+ "math"
9
+ "math/rand"
10
+ "time"
11
+
12
+ gocui "github.com/jroimartin/gocui"
13
+ termbox "github.com/nsf/termbox-go"
14
+ )
15
+
16
+ func main() {
17
+ g, err := gocui.NewGui(gocui.OutputNormal)
18
+ if err != nil {
19
+ log.Panicln(err)
20
+ }
21
+ defer g.Close()
22
+
23
+ g.SetManagerFunc(layout)
24
+
25
+ setupKeybind(g)
26
+
27
+ go func() {
28
+ for {
29
+ time.Sleep(1 * time.Second)
30
+ g.Update(layout)
31
+ }
32
+ }()
33
+
34
+ if err := g.MainLoop(); err != nil && err != gocui.ErrQuit {
35
+ log.Panicln(err)
36
+ }
37
+ }
38
+
39
+ func setupKeybind(g *gocui.Gui) {
40
+ if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {
41
+ log.Panicln(err)
42
+ }
43
+
44
+ if err := g.SetKeybinding("", 'c', gocui.ModNone, changeColor); err != nil {
45
+ log.Panicln(err)
46
+ }
47
+
48
+ if err := g.SetKeybinding("", 'q', gocui.ModNone, quit); err != nil {
49
+ log.Panicln(err)
50
+ }
51
+ }
52
+
53
+ var colmode bool = false
54
+
55
+ func changeColor(g *gocui.Gui, v *gocui.View) error {
56
+ if colmode {
57
+ colmode = false
58
+ } else {
59
+ colmode = true
60
+ }
61
+ return nil
62
+ }
63
+
64
+ // Vertical bar characters
65
+ // ' ': \u0020
66
+ // '▁': \u2581
67
+ // '▂': \u2582
68
+ // '▃': \u2583
69
+ // '▄': \u2584
70
+ // '▅': \u2585
71
+ // '▆': \u2586
72
+ // '▇': \u2587
73
+ // '█': \u2588
74
+ var vbar_runes []rune = []rune(" ▁▂▃▄▅▆▇█")
75
+
76
+ func drawPercent(g *gocui.Gui, x int, y int, height int, pct float64, fg, bg termbox.Attribute) {
77
+ pct = math.Max(0.0, math.Min(100.0, pct))
78
+ pct_ndiv := 9
79
+ if height > 1 {
80
+ pct_ndiv += 8 * (height - 1)
81
+ }
82
+ pct_class := int(pct / (100.0 / float64(pct_ndiv)))
83
+
84
+ col := termbox.ColorBlue
85
+ if 25 <= pct && pct < 50 {
86
+ col = termbox.ColorGreen
87
+ } else if 50 <= pct && pct < 75 {
88
+ col = termbox.ColorYellow
89
+ } else if 75 <= pct {
90
+ col = termbox.ColorRed
91
+ }
92
+
93
+ if !colmode {
94
+ col = termbox.ColorWhite
95
+ }
96
+
97
+ for cell_pos := height - 1; cell_pos >= 0; cell_pos-- {
98
+ vbar_idx := intMin(pct_class, len(vbar_runes)-1)
99
+ termbox.SetCell(x, y+cell_pos, vbar_runes[vbar_idx], col, bg)
100
+ pct_class -= vbar_idx
101
+ }
102
+
103
+ // termbox.SetCell(x, y, vbar_runes[pct_class], fg, bg)
104
+ }
105
+
106
+ func drawRunes(g *gocui.Gui, x int, y int, runes []rune) {
107
+ for _, r := range runes {
108
+ termbox.SetCell(x, y, r, termbox.ColorDefault, termbox.ColorDefault)
109
+ x += 1
110
+ }
111
+ }
112
+
113
+ func intMin(x, y int) int {
114
+ if x > y {
115
+ return y
116
+ } else {
117
+ return x
118
+ }
119
+ }
120
+
121
+ var start_time int64 = time.Now().Unix()
122
+
123
+ func layout(g *gocui.Gui) error {
124
+ // maxX, maxY := g.Size()
125
+ // if v, err := g.SetView("hello", maxX/2-7, maxY/2, maxX/2+7, maxY/2+2); err != nil {
126
+ // if err != gocui.ErrUnknownView {
127
+ // return err
128
+ // }
129
+ // fmt.Fprintln(v, "Hello world!")
130
+ // }
131
+
132
+ for coreid := 0; coreid < 8; coreid++ {
133
+ s := int64(coreid + 1)
134
+ rand.Seed(s)
135
+
136
+ inc := int(time.Now().Unix() - start_time)
137
+ for i := 0; i < inc; i++ {
138
+ rand.Float64()
139
+ }
140
+
141
+ for i := 0; i < 100; i++ {
142
+ // drawPercent(g, i+5, 1+coreid*5, 4, float64(i)/2.0, termbox.ColorDefault, termbox.ColorDefault)
143
+ drawPercent(g, i+6, 1+coreid*5, 4, rand.Float64()*100, termbox.ColorDefault, termbox.ColorDefault)
144
+
145
+ ch := '-'
146
+ if (i+inc)%10 == 0 {
147
+ ch = '+'
148
+ }
149
+ termbox.SetCell(i+6, 1+coreid*5+4, ch, termbox.ColorDefault, termbox.ColorDefault)
150
+ }
151
+ drawRunes(g, 0, 1+coreid*5, []rune(fmt.Sprintf("core%d", coreid)))
152
+
153
+ drawRunes(g, 100+6+1, 1+coreid*5, []rune(fmt.Sprintf("%%usr: % 2.1f", rand.Float64()*30)))
154
+ drawRunes(g, 100+6+1, 1+coreid*5+1, []rune(fmt.Sprintf("%%sys: % 2.1f", rand.Float64()*30)))
155
+ drawRunes(g, 100+6+1, 1+coreid*5+2, []rune(fmt.Sprintf("%%iow: % 2.1f", rand.Float64()*30)))
156
+ drawRunes(g, 100+6+1, 1+coreid*5+3, []rune(fmt.Sprintf("%%oth: % 2.1f", rand.Float64()*30)))
157
+ }
158
+
159
+ return nil
160
+ }
161
+
162
+ func quit(g *gocui.Gui, v *gocui.View) error {
163
+ return gocui.ErrQuit
164
+ }
@@ -159,6 +159,8 @@ EOS
159
159
  plot_disk(meta)
160
160
  plot_cpu(meta)
161
161
 
162
+ FileUtils.rm_rf(@tmpdir)
163
+
162
164
  true
163
165
  end
164
166
 
@@ -1,3 +1,3 @@
1
1
  module PerfMonger
2
- VERSION = "0.11.1"
2
+ VERSION = "0.11.2"
3
3
  end
@@ -4,32 +4,30 @@ WORKDIR /app
4
4
 
5
5
  ## install packages
6
6
  RUN apt-get update
7
- RUN apt-get install -y build-essential libncurses-dev libreadline-dev libssl-dev gnuplot git
7
+ RUN apt-get install -y build-essential libncurses-dev libreadline-dev libssl-dev gnuplot git gnupg2
8
8
 
9
9
  ## get source code
10
10
  RUN git clone https://github.com/hayamiz/perfmonger .
11
11
 
12
12
  ## install RVM
13
- RUN curl -sSL https://get.rvm.io | bash -s stable
13
+ RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
14
+ RUN curl -O https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer
15
+ RUN curl -O https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer.asc
16
+ RUN gpg --verify rvm-installer.asc
17
+ RUN bash rvm-installer stable
14
18
  RUN ln -sf /bin/bash /bin/sh
15
19
 
16
20
  ## install ruby
17
- RUN bash -l -c "rvm install 1.9.3"
18
- RUN bash -l -c "rvm use 1.9.3 && gem install bundler && bundle"
21
+ RUN bash -l -c "rvm install 2.2.10"
22
+ RUN bash -l -c "rvm use 2.2.10 && gem install bundler && bundle"
19
23
 
20
- RUN bash -l -c "rvm install 2.0.0"
21
- RUN bash -l -c "rvm use 2.0.0 && gem install bundler && bundle"
24
+ RUN bash -l -c "rvm install 2.3.8"
25
+ RUN bash -l -c "rvm use 2.3.8 && gem install bundler && bundle"
22
26
 
23
- RUN bash -l -c "rvm install 2.1.10"
24
- RUN bash -l -c "rvm use 2.1.10 && gem install bundler && bundle"
27
+ RUN bash -l -c "rvm install 2.4.5"
28
+ RUN bash -l -c "rvm use 2.4.5 && gem install bundler && bundle"
25
29
 
26
- RUN bash -l -c "rvm install 2.2.5"
27
- RUN bash -l -c "rvm use 2.2.5 && gem install bundler && bundle"
28
-
29
- RUN bash -l -c "rvm install 2.3.1"
30
- RUN bash -l -c "rvm use 2.3.1 && gem install bundler && bundle"
31
-
32
- RUN bash -l -c "rvm install 2.4.0"
33
- RUN bash -l -c "rvm use 2.4.0 && gem install bundler && bundle"
30
+ RUN bash -l -c "rvm install 2.5.3"
31
+ RUN bash -l -c "rvm use 2.5.3 && gem install bundler && bundle"
34
32
 
35
33
  CMD true
@@ -1,5 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
+ set -e
4
+
3
5
  docker build -t go-rvm .
4
6
  docker tag go-rvm hayamiz/go-rvm:wercker-env
5
7
  docker push hayamiz/go-rvm:wercker-env
@@ -6,35 +6,17 @@ build:
6
6
  # http://devcenter.wercker.com/articles/languages/ruby.html
7
7
  steps:
8
8
  - script:
9
- name: switch ruby to 1.9.3
9
+ name: prepare perfmonger go subsystem
10
10
  code: |
11
11
  source /etc/profile.d/rvm.sh
12
- rvm use 1.9.3
13
- - bundle-install
14
- - script:
15
- name: run rspec
16
- code: |
17
- bundle exec rake clean
18
- bundle exec rake go_get
19
- bundle exec rake spec
12
+ rvm use 2.2.10
13
+ rake go_get
20
14
 
21
15
  - script:
22
- name: switch ruby to 2.0.0
23
- code: |
24
- source /etc/profile.d/rvm.sh
25
- rvm use 2.0.0
26
- - bundle-install
27
- - script:
28
- name: run rspec
29
- code: |
30
- bundle exec rake clean
31
- bundle exec rake spec
32
- - script:
33
- name: switch ruby to 2.1.10
16
+ name: switch ruby to 2.2.10
34
17
  code: |
35
-
36
18
  source /etc/profile.d/rvm.sh
37
- rvm use 2.1.10
19
+ rvm use 2.2.10
38
20
  - bundle-install
39
21
  - script:
40
22
  name: run rspec
@@ -43,10 +25,10 @@ build:
43
25
  bundle exec rake spec
44
26
 
45
27
  - script:
46
- name: switch ruby to 2.2.5
28
+ name: switch ruby to 2.3.8
47
29
  code: |
48
30
  source /etc/profile.d/rvm.sh
49
- rvm use 2.2.5
31
+ rvm use 2.3.8
50
32
  - bundle-install
51
33
  - script:
52
34
  name: run rspec
@@ -55,10 +37,10 @@ build:
55
37
  bundle exec rake spec
56
38
 
57
39
  - script:
58
- name: switch ruby to 2.3.1
40
+ name: switch ruby to 2.4.5
59
41
  code: |
60
42
  source /etc/profile.d/rvm.sh
61
- rvm use 2.3.1
43
+ rvm use 2.4.5
62
44
  - bundle-install
63
45
  - script:
64
46
  name: run rspec
@@ -67,10 +49,10 @@ build:
67
49
  bundle exec rake spec
68
50
 
69
51
  - script:
70
- name: switch ruby to 2.4.0
52
+ name: switch ruby to 2.5.3
71
53
  code: |
72
54
  source /etc/profile.d/rvm.sh
73
- rvm use 2.4.0
55
+ rvm use 2.5.3
74
56
  - bundle-install
75
57
  - script:
76
58
  name: run rspec
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perfmonger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuto HAYAMIZU
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-15 00:00:00.000000000 Z
11
+ date: 2020-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,6 +105,7 @@ files:
105
105
  - core/perfmonger-plot-formatter.go
106
106
  - core/perfmonger-recorder.go
107
107
  - core/perfmonger-summarizer.go
108
+ - core/perfmonger-viewer.go
108
109
  - core/subsystem/Makefile
109
110
  - core/subsystem/perfmonger.go
110
111
  - core/subsystem/perfmonger_darwin.go
@@ -137,6 +138,8 @@ files:
137
138
  - lib/exec/perfmonger-recorder_linux_amd64
138
139
  - lib/exec/perfmonger-summarizer_darwin_amd64
139
140
  - lib/exec/perfmonger-summarizer_linux_amd64
141
+ - lib/exec/perfmonger-viewer_darwin_amd64
142
+ - lib/exec/perfmonger-viewer_linux_amd64
140
143
  - lib/perfmonger.rb
141
144
  - lib/perfmonger/cli.rb
142
145
  - lib/perfmonger/command/base_command.rb
@@ -212,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
215
  version: '0'
213
216
  requirements: []
214
217
  rubyforge_project:
215
- rubygems_version: 2.6.11
218
+ rubygems_version: 2.7.6
216
219
  signing_key:
217
220
  specification_version: 4
218
221
  summary: yet anothor performance measurement/monitoring tool