1
0
mirror of https://github.com/golang/go synced 2024-11-18 19:14:40 -07:00

go.tools/dashboard: use shorter notification template for cl updates

LGTM=dvyukov
R=dvyukov
CC=golang-codereviews
https://golang.org/cl/139320043
This commit is contained in:
Andrew Gerrand 2014-09-12 11:14:03 +10:00
parent 83560bf6db
commit 37340ffc2f
2 changed files with 14 additions and 4 deletions

View File

@ -323,10 +323,10 @@ func sendPerfMailFunc(c appengine.Context, com *Commit, prevCommitHash, builder
u := fmt.Sprintf("http://%v/perfdetail?commit=%v&commit0=%v&kind=builder&builder=%v", domain, com.Hash, prevCommitHash, builder)
// prepare mail message
// Prepare mail message (without Commit, for updateCL).
var body bytes.Buffer
err := sendPerfMailTmpl.Execute(&body, map[string]interface{}{
"Builder": builder, "Commit": com, "Hostname": domain, "Url": u, "Benchmarks": benchmarks,
"Builder": builder, "Hostname": domain, "Url": u, "Benchmarks": benchmarks,
})
if err != nil {
c.Errorf("rendering perf mail template: %v", err)
@ -339,7 +339,15 @@ func sendPerfMailFunc(c appengine.Context, com *Commit, prevCommitHash, builder
return
}
// Otherwise, send mail.
// Otherwise, send mail (with Commit, for independent mail message).
body.Reset()
err = sendPerfMailTmpl.Execute(&body, map[string]interface{}{
"Builder": builder, "Commit": com, "Hostname": domain, "Url": u, "Benchmarks": benchmarks,
})
if err != nil {
c.Errorf("rendering perf mail template: %v", err)
return
}
subject := fmt.Sprintf("Perf changes on %s by %s", builder, shortDesc(com.Desc))
msg := &mail.Message{
Sender: mailFrom,

View File

@ -1,8 +1,10 @@
Change {{shortHash .Commit.Hash}} caused perf changes on {{.Builder}}:
{{if .Commit}}Change {{shortHash .Commit.Hash}} caused perf changes on {{.Builder}}:
{{.Commit.Desc}}
http://code.google.com/p/go/source/detail?r={{shortHash .Commit.Hash}}
{{else}}This changed caused perf changes on {{.Builder}}:
{{end}}
{{range $b := .Benchmarks}}
{{printf "%-16s %12s %12s %10s" $b.Name "old" "new" "delta"}}
{{range $m := $b.Metrics}}{{printf "%-16s %12v %12v %+10.2f" $m.Name $m.Old $m.New $m.Delta}}