diff options
author | Valery Piashchynski <[email protected]> | 2020-02-10 22:02:34 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-02-10 22:02:34 +0300 |
commit | 4860f46e00f703d8246c5ec7e4872f484cbadcec (patch) | |
tree | b9c1251d7897c584314ef752d760cff2452c78fd /service | |
parent | f78cc049eec4e264a28edcb1bb95589d4e561cb2 (diff) |
Resolve CR comments
Diffstat (limited to 'service')
-rw-r--r-- | service/container.go | 2 | ||||
-rw-r--r-- | service/metrics/rpc.go | 4 | ||||
-rw-r--r-- | service/metrics/rpc_test.go | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/service/container.go b/service/container.go index 742b4c3b..f6fe24dc 100644 --- a/service/container.go +++ b/service/container.go @@ -89,7 +89,7 @@ func NewContainer(log logrus.FieldLogger) Container { } } -// Register add new service to the container under given name. +// Declare add new service to the container under given name. func (c *container) Register(name string, service interface{}) { c.mu.Lock() defer c.mu.Unlock() diff --git a/service/metrics/rpc.go b/service/metrics/rpc.go index 9a36f14c..377d6173 100644 --- a/service/metrics/rpc.go +++ b/service/metrics/rpc.go @@ -134,13 +134,13 @@ func (rpc *rpcServer) Observe(m *Metric, ok *bool) (err error) { *ok = true return nil } -// Register is used to register new collector in prometheus +// Declare is used to register new collector in prometheus // THE TYPES ARE: // NamedCollector -> Collector with the name // bool -> RPC reply value // RETURNS: // error -func (rpc *rpcServer) Register(c *NamedCollector, ok *bool) (err error) { +func (rpc *rpcServer) Declare(c *NamedCollector, ok *bool) (err error) { // MustRegister could panic, so, to return error and not shutdown whole app // we recover and return error defer func() { diff --git a/service/metrics/rpc_test.go b/service/metrics/rpc_test.go index 3ef205c4..2fc4bc32 100644 --- a/service/metrics/rpc_test.go +++ b/service/metrics/rpc_test.go @@ -252,7 +252,7 @@ func Test_Register_RPC_Histogram(t *testing.T) { defer c.Stop() var ok bool - assert.NoError(t, client.Call("metrics.Register", &NamedCollector{ + assert.NoError(t, client.Call("metrics.Declare", &NamedCollector{ Name: "custom_histogram", Collector: Collector{ Namespace: "test_histogram", @@ -296,7 +296,7 @@ func Test_Register_RPC_Gauge(t *testing.T) { defer c.Stop() var ok bool - assert.NoError(t, client.Call("metrics.Register", &NamedCollector{ + assert.NoError(t, client.Call("metrics.Declare", &NamedCollector{ Name: "custom_gauge", Collector: Collector{ Namespace: "test_gauge", @@ -346,7 +346,7 @@ func Test_Register_RPC_Counter(t *testing.T) { defer c.Stop() var ok bool - assert.NoError(t, client.Call("metrics.Register", &NamedCollector{ + assert.NoError(t, client.Call("metrics.Declare", &NamedCollector{ Name: "custom_counter", Collector: Collector{ Namespace: "test_counter", @@ -387,7 +387,7 @@ func Test_Register_RPC_Summary(t *testing.T) { defer c.Stop() var ok bool - assert.NoError(t, client.Call("metrics.Register", &NamedCollector{ + assert.NoError(t, client.Call("metrics.Declare", &NamedCollector{ Name: "custom_summary", Collector: Collector{ Namespace: "test_summary", |