mirror of
https://github.com/nikdoof/vsphere-influxdb-go.git
synced 2025-12-19 05:29:21 +00:00
add vendoring with go dep
This commit is contained in:
28
vendor/github.com/influxdata/influxdb/monitor/system.go
generated
vendored
Normal file
28
vendor/github.com/influxdata/influxdb/monitor/system.go
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package monitor
|
||||
|
||||
import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/influxdata/influxdb/monitor/diagnostics"
|
||||
)
|
||||
|
||||
var startTime time.Time
|
||||
|
||||
func init() {
|
||||
startTime = time.Now().UTC()
|
||||
}
|
||||
|
||||
// system captures system-level diagnostics.
|
||||
type system struct{}
|
||||
|
||||
func (s *system) Diagnostics() (*diagnostics.Diagnostics, error) {
|
||||
d := map[string]interface{}{
|
||||
"PID": os.Getpid(),
|
||||
"currentTime": time.Now().UTC(),
|
||||
"started": startTime,
|
||||
"uptime": time.Since(startTime).String(),
|
||||
}
|
||||
|
||||
return diagnostics.RowFromMap(d), nil
|
||||
}
|
||||
Reference in New Issue
Block a user