1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-26 13:48:53 +08:00
Mainflux.mainflux/version.go

25 lines
447 B
Go
Raw Normal View History

package mainflux
import (
"encoding/json"
"net/http"
)
MF-134 - Evaluate system's performance (#225) * Add initial load tests Add initial load tests for client creation and message publishing. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Make load tests executable as stand-alone application Move code from test to main. Make code runnable with sbt run command. Remove unnecessary config files. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Add native packager support Add native packager plugin. Update sbt config to support native packager. Update paths in Engine.scala. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Move files back to test folder and remove native packager support Remove nativa packager plugin. Add gatling plugin and move files to test folder where they belong. Read vars from JAVA_OPTS instead of environment variables. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Add readme file for load tests Add readme file for load tests with usage instructions. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Add number of requests per second as test parameter Add number of requests per second as parameter. Update read me according to this addition. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Add load test section in docs Create documentation skeleton for load tests. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Reformat logger config file Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Update documentation skeleton Move results section to scenarios. Move test environment to intro. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Align test version with mainflux version Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Update mainflux version to 0.2.2 Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
2018-04-23 15:13:43 +02:00
const version string = "0.2.2"
type response struct {
Version string
Service string
}
// Version exposes an HTTP handler for retrieving service version.
func Version(service string) http.HandlerFunc {
return http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) {
res := response{Version: version, Service: service}
data, _ := json.Marshal(res)
rw.Write(data)
})
}