Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test gh checks api #60

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cloudbuild.release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ steps:
entrypoint: /bin/sh
dir: gopath/src/github.com
env: ['GOPATH=/workspace/gopath']
args: ['-c', 'cd ncabatoff/process-exporter && git tag && /goreleaser' ]
args: ['-c', 'cd ncabatoff/process-exporter && git tag $TAG_NAME && /goreleaser' ]
secretEnv: ['GITHUB_TOKEN']

secrets:
Expand Down
5 changes: 5 additions & 0 deletions proc/read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,8 @@ func TestIterator(t *testing.T) {
t.Errorf("procs differs: (-got +want)\n%s", diff)
}
}

// Fail, to test checks API
func TestFail(t *testing.T) {
t.Fail()
}
16 changes: 13 additions & 3 deletions proc/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,22 @@ func (t *Tracker) handleProc(proc Proc, updateTime time.Time) (*IDInfo, CollectE
}
return nil, cerrs
}
cerrs.Partial += softerrors

var threads []Thread
if t.trackThreads {
threads, _ = proc.GetThreads()
threads, err = proc.GetThreads()
if err != nil {
softerrors |= 1
}
cerrs.Partial += softerrors

if len(threads) > 0 {
metrics.Counts.CtxSwitchNonvoluntary, metrics.Counts.CtxSwitchVoluntary = 0, 0
for _, thread := range threads {
metrics.Counts.CtxSwitchNonvoluntary += thread.Counts.CtxSwitchNonvoluntary
metrics.Counts.CtxSwitchVoluntary += thread.Counts.CtxSwitchVoluntary
}
}

var newProc *IDInfo
if known {
last.update(metrics, updateTime, &cerrs, threads)
Expand Down