This repository has been archived by the owner on Oct 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
format.go
41 lines (37 loc) · 1.64 KB
/
format.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package log2csv
import (
"regexp"
"time"
)
type Log struct {
Timestamp time.Time
Format *Format
Fields []string
}
type Format struct {
Name string
Header string
Pattern *regexp.Regexp
}
var GCTraceFormats = []*Format{
{
"Go 1.0",
"numgc,nproc,mark,sweep,cleanup,heap0,heap1,obj0,obj1,nmalloc,nfree,nhandoff",
regexp.MustCompile(`gc(\d+)\((\d+)\): (\d+)\+(\d+)\+(\d+) \w+ (\d+) -> (\d+) \w+ (\d+) -> (\d+) \((\d+)-(\d+)\) objects (\d+) handoff`),
},
{
"Go 1.1",
"numgc,nproc,mark,sweep,cleanup,heap0,heap1,obj0,obj1,nmalloc,nfree,nhandoff,nhandoffcnt,nsteal,nstealcnt,nprocyield,nosyield,nsleep",
regexp.MustCompile(`gc(\d+)\((\d+)\): (\d+)\+(\d+)\+(\d+) \w+, (\d+) -> (\d+) \w+ (\d+) -> (\d+) \((\d+)-(\d+)\) objects, (\d+)\((\d+)\) handoff, (\d+)\((\d+)\) steal, (\d+)\/(\d+)\/(\d+) yields`),
},
{
"Go 1.3",
"numgc,nproc,seq,sweep,mark,wait,heap0,heap1,obj,nmalloc,nfree,nspan,nbgsweep,npausesweep,nhandoff,nhandoffcnt,nsteal,nstealcnt,nprocyield,nosyield,nsleep",
regexp.MustCompile(`gc(\d+)\((\d+)\): (\d+)\+(\d+)\+(\d+)\+(\d+) \w+, (\d+) -> (\d+) \w+, (\d+) \((\d+)-(\d+)\) objects, (\d+)\/(\d+)\/(\d+) sweeps, (\d+)\((\d+)\) handoff, (\d+)\((\d+)\) steal, (\d+)\/(\d+)\/(\d+) yields`),
},
{
"Go 1.4",
"numgc,nproc,seq,sweep,mark,wait,heap0,heap1,obj,nmalloc,nfree,goroutines,nspan,nbgsweep,npausesweep,nhandoff,nhandoffcnt,nsteal,nstealcnt,nprocyield,nosyield,nsleep",
regexp.MustCompile(`gc(\d+)\((\d+)\): (\d+)\+(\d+)\+(\d+)\+(\d+) \w+, (\d+) -> (\d+) \w+, (\d+) \((\d+)-(\d+)\) objects, (\d+) goroutines, (\d+)\/(\d+)\/(\d+) sweeps, (\d+)\((\d+)\) handoff, (\d+)\((\d+)\) steal, (\d+)\/(\d+)\/(\d+) yields`),
},
}