-
Notifications
You must be signed in to change notification settings - Fork 13
/
stats.go
39 lines (32 loc) · 811 Bytes
/
stats.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
// ClueGetter - Does things with mail
//
// Copyright 2016 Dolf Schimmel, Freeaqingme.
//
// This Source Code Form is subject to the terms of the two-clause BSD license.
// For its contents, please refer to the LICENSE file.
//
package core
import (
"sync"
)
var StatsControl = make(chan struct{})
var StatsCounters = make(map[string]*StatsCounter)
var StatsCountersMutex = &sync.Mutex{}
type statsDatapoint struct {
timestamp int64 // time.Now().Nanoseconds()
value int32
}
type StatsCounter struct {
mu sync.Mutex
dataPoints []*statsDatapoint
total int32
ignore_prune bool
}
func (s *StatsCounter) increase(value int32) {
return
}
func statsInitCounter(name string) {
StatsCountersMutex.Lock()
defer StatsCountersMutex.Unlock()
StatsCounters[name] = &StatsCounter{}
}