-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetrics.go
More file actions
30 lines (28 loc) · 985 Bytes
/
metrics.go
File metadata and controls
30 lines (28 loc) · 985 Bytes
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
package batch_query
import "time"
// MetricsWriter is an interface of query metrics handler.
// See example of implementations metrics subfolder.
type MetricsWriter interface {
// Fetch registers income single request.
Fetch()
// OK register successful processing of single request.
OK(duration time.Duration)
// NotFound registers single request failed due to empty response.
NotFound()
// Timeout registers single request filed due to timeout error.
Timeout()
// Interrupt registers single request failed due to interrupt signal.
Interrupt()
// Fail registers any other error encountered.
Fail()
// Batch register processing start of batch.
Batch()
// BatchOK register successful processing of batch.
BatchOK(duration time.Duration)
// BatchFail registers failed batch processing.
BatchFail()
// BufferIn registers incoming of new batch to internal buffer.
BufferIn(reason string)
// BufferOut registers outcoming of batch from internal buffer.
BufferOut()
}