1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-28 13:48:49 +08:00

66 lines
2.0 KiB
Go
Raw Normal View History

NOISSUE - Simplify MQTT benchmarking tool (#852) * Fix user creation Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Extract client creation to separate method Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove message generating in separate goroutine Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove runSub and runPub methods Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Refactor benchmark code Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix typos Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update client message handling Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix microseconds typo Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Simplify client Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Don't take zero-messages clients int count Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Fix token timeout condition Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Add timeout for publisher Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Update Paho lib version Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Temporary drop SenML and subscribe support Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Calculate payload size Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com> * Remove templates Signed-off-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2019-09-25 19:02:29 +02:00
package bench
// Keep struct names exported, otherwise Viper unmarshalling won't work
type mqttBrokerConfig struct {
URL string `toml:"url" mapstructure:"url"`
}
type mqttMessageConfig struct {
Size int `toml:"size" mapstructure:"size"`
Payload string `toml:"payload" mapstructure:"payload"`
Format string `toml:"format" mapstructure:"format"`
QoS int `toml:"qos" mapstructure:"qos"`
Retain bool `toml:"retain" mapstructure:"retain"`
}
type mqttTLSConfig struct {
MTLS bool `toml:"mtls" mapstructure:"mtls"`
SkipTLSVer bool `toml:"skiptlsver" mapstructure:"skiptlsver"`
CA string `toml:"ca" mapstructure:"ca"`
}
type mqttConfig struct {
Broker mqttBrokerConfig `toml:"broker" mapstructure:"broker"`
Message mqttMessageConfig `toml:"message" mapstructure:"message"`
Timeout int `toml:"timeout" mapstructure:"timeout"`
TLS mqttTLSConfig `toml:"tls" mapstructure:"tls"`
}
type testConfig struct {
Count int `toml:"count" mapstructure:"count"`
Pubs int `toml:"pubs" mapstructure:"pubs"`
Subs int `toml:"subs" mapstructure:"subs"`
}
type logConfig struct {
Quiet bool `toml:"quiet" mapstructure:"quiet"`
}
type mainfluxFile struct {
ConnFile string `toml:"connections_file" mapstructure:"connections_file"`
}
type mfThing struct {
ThingID string `toml:"thing_id" mapstructure:"thing_id"`
ThingKey string `toml:"thing_key" mapstructure:"thing_key"`
MTLSCert string `toml:"mtls_cert" mapstructure:"mtls_cert"`
MTLSKey string `toml:"mtls_key" mapstructure:"mtls_key"`
}
type mfChannel struct {
ChannelID string `toml:"channel_id" mapstructure:"channel_id"`
}
type mainflux struct {
Things []mfThing `toml:"things" mapstructure:"things"`
Channels []mfChannel `toml:"channels" mapstructure:"channels"`
}
// Config struct holds benchmark configuration
type Config struct {
MQTT mqttConfig `toml:"mqtt" mapstructure:"mqtt"`
Test testConfig `toml:"test" mapstructure:"test"`
Log logConfig `toml:"log" mapstructure:"log"`
Mf mainfluxFile `toml:"mainflux" mapstructure:"mainflux"`
}