Mainflux.mainflux/lora/api/metrics.go

113 lines
3.5 KiB
Go
Raw Normal View History

// Copyright (c) Mainflux
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
// SPDX-License-Identifier: Apache-2.0
MF-1308 - Use IETF Health Check standard (#1541) * MF-1308 - Use IETF Health Check standard Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add nginx health endpoint Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm github.com/nelkinda dependency Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Check error Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Replace Version by Health in the CLI and SDK Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use new build flag go:build Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert wrong renaming Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * sdk health test Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add /health endpoint to openapi doc Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use const for description message Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add version and build time during build Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Time format Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add version and commit using git and build args Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add comments Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add tests Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add missing api properties Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix api Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use ./schemas/HealthInfo.yml as Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix example Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use content type application/health+json Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Set Makefile variables only if empty Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2022-01-25 04:18:53 +08:00
//go:build !test
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
package api
import (
"context"
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
"time"
"github.com/go-kit/kit/metrics"
"github.com/mainflux/mainflux/lora"
)
var _ lora.Service = (*metricsMiddleware)(nil)
type metricsMiddleware struct {
counter metrics.Counter
latency metrics.Histogram
svc lora.Service
}
// MetricsMiddleware instruments core service by tracking request count and latency.
func MetricsMiddleware(svc lora.Service, counter metrics.Counter, latency metrics.Histogram) lora.Service {
return &metricsMiddleware{
counter: counter,
latency: latency,
svc: svc,
}
}
func (mm *metricsMiddleware) CreateThing(ctx context.Context, thingID string, loraDevEUI string) error {
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
defer func(begin time.Time) {
mm.counter.With("method", "create_thing").Add(1)
mm.latency.With("method", "create_thing").Observe(time.Since(begin).Seconds())
}(time.Now())
return mm.svc.CreateThing(ctx, thingID, loraDevEUI)
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
}
func (mm *metricsMiddleware) UpdateThing(ctx context.Context, thingID string, loraDevEUI string) error {
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
defer func(begin time.Time) {
mm.counter.With("method", "update_thing").Add(1)
mm.latency.With("method", "update_thing").Observe(time.Since(begin).Seconds())
}(time.Now())
return mm.svc.UpdateThing(ctx, thingID, loraDevEUI)
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
}
func (mm *metricsMiddleware) RemoveThing(ctx context.Context, thingID string) error {
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
defer func(begin time.Time) {
mm.counter.With("method", "remove_thing").Add(1)
mm.latency.With("method", "remove_thing").Observe(time.Since(begin).Seconds())
}(time.Now())
return mm.svc.RemoveThing(ctx, thingID)
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
}
func (mm *metricsMiddleware) CreateChannel(ctx context.Context, chanID, loraApp string) error {
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
defer func(begin time.Time) {
mm.counter.With("method", "create_channel").Add(1)
mm.latency.With("method", "create_channel").Observe(time.Since(begin).Seconds())
}(time.Now())
return mm.svc.CreateChannel(ctx, chanID, loraApp)
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
}
func (mm *metricsMiddleware) UpdateChannel(ctx context.Context, chanID, loraApp string) error {
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
defer func(begin time.Time) {
mm.counter.With("method", "update_channel").Add(1)
mm.latency.With("method", "update_channel").Observe(time.Since(begin).Seconds())
}(time.Now())
return mm.svc.UpdateChannel(ctx, chanID, loraApp)
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
}
func (mm *metricsMiddleware) RemoveChannel(ctx context.Context, chanID string) error {
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
defer func(begin time.Time) {
mm.counter.With("method", "remove_channel").Add(1)
mm.latency.With("method", "remove_channel").Observe(time.Since(begin).Seconds())
}(time.Now())
return mm.svc.RemoveChannel(ctx, chanID)
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
}
func (mm *metricsMiddleware) ConnectThing(ctx context.Context, chanID, thingID string) error {
defer func(begin time.Time) {
mm.counter.With("method", "connect_thing").Add(1)
mm.latency.With("method", "connect_thing").Observe(time.Since(begin).Seconds())
}(time.Now())
return mm.svc.ConnectThing(ctx, chanID, thingID)
}
func (mm *metricsMiddleware) DisconnectThing(ctx context.Context, chanID, thingID string) error {
defer func(begin time.Time) {
mm.counter.With("method", "disconnect_thing").Add(1)
mm.latency.With("method", "disconnect_thing").Observe(time.Since(begin).Seconds())
}(time.Now())
return mm.svc.DisconnectThing(ctx, chanID, thingID)
}
func (mm *metricsMiddleware) Publish(ctx context.Context, msg *lora.Message) error {
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
defer func(begin time.Time) {
MF-886 - Add OPC-UA adapter (#878) * NOISSUE- Add OPC-UA adapter Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add opc-adapter PoC, docker and vendor Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Convert OPC messages to SenML Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add gopcua package Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * lora-adapter typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add OPC Reader Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Typo fix Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Typo fix Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update copyright headers Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add opc config Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add all opc envars in the config Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Config typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add route map Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Use opcua package instead of opc Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix OPCUA typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm MQTT sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Move interefaces to root Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix revieews and typo Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add all envars into .env Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2019-10-22 23:44:19 +08:00
mm.counter.With("method", "publish").Add(1)
mm.latency.With("method", "publish").Observe(time.Since(begin).Seconds())
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
}(time.Now())
return mm.svc.Publish(ctx, msg)
MF-166 - Add lora-adapter service (#481) * MF-166 - Add lora-adapter service (#416) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * MF-166 - Add lora-adapter service (#461) * MF-166 - Add lora-adapter service Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix NATS connexion and use credentials with gRPC Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Forward lora msgs to nats Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Add make cmd and docker-compose Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Define lora conf as private Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename funcs fix nats conn Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README and fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rm NATS sub Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix lora server topic and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix HTTP port Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * NOISSUE - Add event sourcing client to LoRa adapter (#471) * Add event sourcing client to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Update redis version in docker compose and update env vars Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add ES subscription to main LoRa function Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add new env vars to readme file of LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add message acknowledgement to LoRa adapter Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add handling of empty values to event sourcing client (#474) Signed-off-by: Aleksandar Novaković <anovakovic01@gmail.com> * Add routemap and handle event sourcing Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix eventStore decoding Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Mv docker-compose in docker/addons Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix routemap and logs Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update Gopkg.toml Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix route map and typos Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Update README Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix reviews Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
2018-12-05 03:08:30 +08:00
}