Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevan committed Jan 5, 2020
1 parent 4515459 commit 4ffe476
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/pgmetrics/csv.go
@@ -1,5 +1,5 @@
/*
* Copyright 2019 RapidLoop, Inc.
* Copyright 2020 RapidLoop, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmd/pgmetrics/main.go
@@ -1,5 +1,5 @@
/*
* Copyright 2019 RapidLoop, Inc.
* Copyright 2020 RapidLoop, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion cmd/pgmetrics/report.go
@@ -1,5 +1,5 @@
/*
* Copyright 2019 RapidLoop, Inc.
* Copyright 2020 RapidLoop, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion collector/collect.go
@@ -1,5 +1,5 @@
/*
* Copyright 2019 RapidLoop, Inc.
* Copyright 2020 RapidLoop, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions collector/log.go
Expand Up @@ -20,7 +20,7 @@ var (
rxAEStart = regexp.MustCompile(`^duration: [0-9]+\.[0-9]+ ms plan:\n[ \t]+({[ \t]*\n)?(<explain xml.*\n)?(Query Text: ".*"\n)?(Query Text: [^"].*\n)?`)
rxAESwitch1 = regexp.MustCompile(`^\s+Query Text: (.*)$`)
rxAESwitch2 = regexp.MustCompile(`cost=\d+.*rows=\d`)
rxAVStart = regexp.MustCompile(`automatic (aggressive )?vacuum (to prevent wraparound)?of table "([^"]+)": index`)
rxAVStart = regexp.MustCompile(`automatic (aggressive )?vacuum (to prevent wraparound )?of table "([^"]+)": index`)
rxAVElapsed = regexp.MustCompile(`, elapsed: ([0-9.]+) s`)
)

Expand Down Expand Up @@ -235,7 +235,7 @@ func (c *collector) processAE(sm []string) {
}
case len(sm[2]) > 0:
p.Format = "xml"
log.Print("warning: yaml format auto_explain output not supported yet")
log.Print("warning: xml format auto_explain output not supported yet")
case len(sm[3]) > 0:
p.Format = "yaml"
log.Print("warning: yaml format auto_explain output not supported yet")
Expand Down
2 changes: 1 addition & 1 deletion collector/system_darwin.go
@@ -1,5 +1,5 @@
/*
* Copyright 2019 RapidLoop, Inc.
* Copyright 2020 RapidLoop, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion collector/system_freebsd.go
@@ -1,5 +1,5 @@
/*
* Copyright 2019 RapidLoop, Inc.
* Copyright 2020 RapidLoop, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion collector/system_linux.go
@@ -1,5 +1,5 @@
/*
* Copyright 2019 RapidLoop, Inc.
* Copyright 2020 RapidLoop, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion collector/system_windows.go
@@ -1,5 +1,5 @@
/*
* Copyright 2019 RapidLoop, Inc.
* Copyright 2020 RapidLoop, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
6 changes: 4 additions & 2 deletions model.go
@@ -1,5 +1,5 @@
/*
* Copyright 2019 RapidLoop, Inc.
* Copyright 2020 RapidLoop, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ package pgmetrics

// ModelSchemaVersion is the schema version of the "Model" data structure
// defined below. It is in the "semver" notation. Version history:
// 1.7 - query execution plans, autovacuum, deadlocks
// 1.7 - query execution plans, autovacuum, deadlocks, table acl
// 1.6 - added highest WAL segment number
// 1.5 - add PID to replication_outgoing entries
// 1.4 - pgbouncer information
Expand Down Expand Up @@ -637,6 +637,8 @@ type AutoVacuum struct {
Elapsed float64 `json:"elapsed"` // in seconds
}

// Deadlock contains information about a single deadlock detection log.
// Added in schema 1.7.
type Deadlock struct {
At int64 `json:"at"` // time when activity was logged, as seconds since epoch
Detail string `json:"detail"` // information about the deadlocking processes
Expand Down

0 comments on commit 4ffe476

Please sign in to comment.