This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 304
/
publish.go
73 lines (58 loc) · 2.58 KB
/
publish.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package metricsware
import (
"context"
"github.com/google/exposure-notifications-server/internal/metrics/publish"
"go.opencensus.io/stats"
)
func (m Middleware) RecordHealthAuthorityNotAuthorized(ctx context.Context) {
(*m.exporter).WriteInt("publish-health-authority-not-authorized", true, 1)
stats.Record(ctx, publish.HealthAuthorityNotAuthorized.M(1))
}
func (m Middleware) RecordErrorLoadingAuthorizedApp(ctx context.Context) {
(*m.exporter).WriteInt("publish-error-loading-authorizedapp", true, 1)
stats.Record(ctx, publish.ErrorLoadingAuthorizedApp.M(1))
}
func (m Middleware) RecordRegionNotAuthorized(ctx context.Context) {
(*m.exporter).WriteInt("publish-region-not-authorized", true, 1)
stats.Record(ctx, publish.RegionNotAuthorized.M(1))
}
func (m Middleware) RecordRegionNotSpecified(ctx context.Context) {
(*m.exporter).WriteInt("publish-region-not-specified", true, 1)
stats.Record(ctx, publish.RegionNotSpecified.M(1))
}
func (m Middleware) RecordVerificationBypassed(ctx context.Context) {
(*m.exporter).WriteInt("publish-health-authority-verification-bypassed", true, 1)
stats.Record(ctx, publish.VerificationBypassed.M(1))
}
func (m Middleware) RecordBadVerification(ctx context.Context) {
(*m.exporter).WriteInt("publish-bad-verification", true, 1)
stats.Record(ctx, publish.BadVerification.M(1))
}
func (m Middleware) RecordTransformFail(ctx context.Context) {
(*m.exporter).WriteInt("publish-transform-fail", true, 1)
stats.Record(ctx, publish.TransformFail.M(1))
}
func (m Middleware) RecordRevisionTokenIssue(ctx context.Context, metric string) {
(*m.exporter).WriteInt(metric, true, 1)
stats.Record(ctx, publish.RevisionTokenIssue.M(1))
}
func (m Middleware) RecordInsertions(ctx context.Context, insertions int) {
(*m.exporter).WriteInt("publish-exposures-inserted", true, insertions)
stats.Record(ctx, publish.ExposuresInserted.M(int64(insertions)))
}
func (m Middleware) RecordRevisions(ctx context.Context, revisions int) {
(*m.exporter).WriteInt("publish-exposures-revised", true, revisions)
stats.Record(ctx, publish.ExposuresInserted.M(int64(revisions)))
}
func (m Middleware) RecordDrops(ctx context.Context, drops int) {
(*m.exporter).WriteInt("publish-exposures-dropped", true, drops)
stats.Record(ctx, publish.ExposuresInserted.M(int64(drops)))
}
func (m Middleware) RecordBadJSON(ctx context.Context) {
(*m.exporter).WriteInt("publish-bad-json", true, 1)
stats.Record(ctx, publish.BadJSON.M(1))
}
func (m Middleware) RecordPaddingFailure(ctx context.Context) {
(*m.exporter).WriteInt("padding-failed", true, 1)
stats.Record(ctx, publish.PaddingFailed.M(1))
}